2) First Java Program
2) First Java Program
System.out.println("Hello World!!");
}
}
i) Choose My Computer -> Right Click -> Properties -> Advanced Tab ->
Environment Variables -> System Variables -> choose PATH and click EDIT
ii) Variable Name will be there as PATH and in the Variable Value, add a
semicolon and give the path for the bin folder of the JDK:
;C:\Program Files\Java\jdk1.6.0_21\bin
iii) If PATH variable is not there, click NEW and specify Variable Name as PATH
and Variable Value as C:\Program Files\Java\jdk1.6.0_21\bin
iv) Click OK to close all windows.
System.out.println("Hello World!!");
}
}
6) Right click the project and choose Run As -> Java Application
7) Output is displayed in Console Window in bottom.
1) public - keyword:
It is the Access Specifier. When a class is public, it can be accessed by any other class.
2) class – keyword:
It is used to declare as a class and can be instantiated with objects or can be inherited
by another class.