Wednesday, 14 February 2018

Some Important detail of First Java Program

Some Important detail of First Java Program

  • Class:- This keyword is used to declare a class in java and class is the collection of object. 
  • public:- This keyword is an access modifier which represents visibility, it means it is visible to all. It means it is open to use by all other class like a public park which is open for all. 
  • static:- This is a keyword, if we declare any method as static, it is known as static method. The core advantage of static method is that there is no need to create object to invoke the static
    method. The main method is executed by the JVM, so it doesn't require to create object to invoke
    the main method.
  •  void:- is the return type of the method, it means it doesn't return any value. 
  • main:- represents startup of the program. It’s start the execution of main program 
  • String[] args:- it is used for command line argument.it change line into String for jvm. 
  • System.out.println():- is used print statement. System is a class itself. out is used to make output stream. Print is used to print something on display. println is same but it send cursor to next line after execution of code. 
  • String[] args: it can represented by Many ways
    1. public static void main(String[] args) 
    2. public static void main(String []args) 
    3. public static void main(String args[]) 
    4. public static void main(String[] args) 
    5. public static void main(String []args) 
    6. public static void main(String args[])

0 comments:

Post a Comment