Wednesday, 30 September 2015

First Java Program

Before initiating this let me make it very clear "Java is Case Sensitive Language".For  example if u have a method called forth() n if u have written Forth() while accessing this method than it is not correct as compiler might throw an error saying method not found.

To begin with we require following:

1.An IDE---  NetBeans 8.0 for windows 8.U can use different version compatible with your Operating System.

So Over here what u do is create a Java Application n start with your first program.

The First program is shown below:



You can view the output  as shown.



If you just want to opt for manual editor like notepad for executing java program then here are the screens which demonstrate the procedure.



You might be wondering why there is no import stmt just like how we include header files in C, because even if we don't mention the package gets imported by default over here.This package is java.lang.* package.


 

setting java class path in windows 8

Hello Everyone

To set java classpath first you have to download JDK compatible for ur Operating System.
So for windows 8,  JDK 1.7 and JDK 1.8 are compatible.To download these software go to the url mentioned below:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

U'll be provided with different JDK for different Operating System.After Downloading JDK 1.7 , click the executable file and follow the instructions.Please select an appropriate drive for installing either it be C: D: or anything else

In my case i'd prefer C: drive after installation .It is important to set java class path.There different ways of setting this path.Let's opt for the simple one.

So now what u have to do is go to the jdk1.7 folder and copy that path.

U have to paste it in System variables(PATH).
plz do not delete the value for this variable as it might lead to severe problems.Better paste this path at the begging than followed by semicolon.


To check if java got installed correctly, open command prompt and type javac.Here are few snaps to ease ur process.


 

Thursday, 17 September 2015

JAVA INTRODUCTION

Java---A platform independent programming language.

platform independent--

we can write java programs once and run it anywhere.Here JVM comes into picture. JVM(java virtual machine) it is used to run java programs and it is platform dependent which means every operating system have their own compatible JVM's.

Introduction:

Java as u all know was developed in Jan 1991 by James Gosling et.al(Chris wrath,ed frank,mike Sheridan,Patrick naughton).This language was system independent and was initially called  Oak and renamed to java later on.

Symbol for java language-- cup and saucer.

Sun formally announced Java at sun world conference in 1995.

On Jan 23 1996 , JDK 1.0 version was released.

Java is an OOP(Object Oriented Programming)Language.

what is OOP?
main program is divided into small objects depending on the problem.
it follows Bottom up process for program design.

Features of  OOP:

1.Class
2.Object
3.Encapsulation
4.Abstraction
5.Inheritance
6.Message Passing

we'll these features in detail in my later post for now lets move on to
1.software installation
2.setting java class path
3. and our first java program

1.Software Installation

So we can download  JDK software from  http://www.oracle.com/technetwork/java/javase/downloads/index.html

Every Language requires an editor where we can write our programs and a compiler which converts it into machine language.Many Vendors have provided the combination of both in the form of Integrated Development Environment(IDE).And to name a few we have Eclipse IDE and Netbeans IDE.


Based on the version of your OS you can download these softwares. The url mentioned above will allow u install Netbeans IDE version 8 along with Java 8.

Follow the steps mentioned there.After downloading it u can better start with ur first java program

Now for those who prefer manual editor go to the above url and install java compatible with you OS.After that we have to set the java path.


To set the java classpath.Browse the folder where java got installed

"C:\Program Files\Java\jdk7.0\bin" ---copy this path using ctrl+c

Right Click MyComputer --go to properties--there u'll see an Advanced Tab--Click it n then open Environment Variables.

A new Screen opens up showing u the
user defined variable
system variable

In both places Click New--Type variable name as classpath/JAVA_HOME then paste the copied path in the next field.save it

Now to know if java got installed or not
Open Cmd Prompt--type javac

then relevant details gets displayed else u'll get an error saying "cmd not supported"
In Next Post we'll learn setting Java path in detail.



Sunday, 13 September 2015

technical skills

Hello Everyone

U r always required to focus on your technical skills once u r done with ur graduation,post graduation etc.
So basically u r reqd to learn programming languages n databases.

I'll be focusing on java as it is the most popular programming language.
Next post would be on  Introduction to java