Java
is OOPS language, it supports OOPS features… go2 first page- Data encapsulation
- Inheritance
- Polymorphism
…These are few among them..
Java program starts with class and main method will be included in the class.
Unlike C,C++ in java main method will pass String.Lets go to an example.
example:
public static void main(String args[])
{
}
Here
public keyword is access specifier, which allows the programmer to control visibility of class members.
Keyword static allows main() to be called with out having to instantiate by particular instance(object) of a class, this is necessary since main() is called by JVM (Java virtual machine) before any objects are made.
String args[] declares parameter args, which is an array of instances in class String.(Arrays are collection of similar objects).
Note:
java program will be complied with out main but java can`t run the program with out main.Lets see a java program
No comments:
Post a Comment