Friday, October 15, 2010

About java language

Java

is OOPS language, it supports OOPS features… go2 first page
Encapsulation is the mechanism that binds the code and the data it manipulates, keeps safe from both out side inheritance and misuse.
  • Inheritance
Inheritance is the process by which one object`s properties are acquired and used by other object. In short code re-usability. It is achieved by extends keyword in Java.
  • Polymorphism
In short Polymorphism mean many forms, one interface will be used for many tasks.This will be explained detailed with example.
…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