Object – Objects have states and behaviors. An object is an instance of a class.
Class - A class can be defined as a template/blue print that describes the behaviors/states that object of its type support.
Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.

My First Java Program

Import java.io.*;
Class  Prog1
public static void main(String args[])
System.out.println("This is my first program");

Type ' javac Prog1.java ' and press enter to compile your code. If there are no errors in your code, The command prompt will take you to the next line(Assumption : The path variable is set).

C :> javac Prog1.java
C :> java Prog1

About Java programs, it is very important to keep in mind the following points.
1.Case Sensitivity
Java is case sensitive, which means identifier Hello and hello would have differentmeaning in Java.
2.Class Names
For all class names, the first letter should be in Upper Case.If several words are used to form a name of the class, each inner word's first letter should be in Upper Case.
Example class MyFirstJavaClass
3.Method Names
All method names should start with a Lower Case letter.If several words are used to form the name of the method, then each inner word's first letter should be inUpper Case.
Example public void myMethodName()
4.Program File Name
Name of the program file should exactly match the class name.When saving the file, you should save it using the class name (Remember Java is case sensitive) and append'. java' to the end of the name (if the file name and the class name do not match your program will not compile).
5.public static void main(String args[])
Java program processing starts from the main() method, which is amandatory part of every Java program.

Java Keywords

Keywords are an essential part of a language defination.They implement specific features of the language. Java language has reserved 60 words as keyword.These keywords,combined operators and separators according to suntax, from defination of the java language.


News Walls

Copyrights © 2016. All Rights Reserved to Learn Computers Home, India. //Site Designed.