What is this java code ? Explain java class structure

This Is class 

class Hello {

                    }




This Is class  Main Method


public static void main(String args[]){
   
}



This Is class  Main Method and Output Get  Hello World This is ezcod.blogspot.com


class Hello {
  
 public static void main(String args[]){
   
     System.out.println("Hello,i am ezcod.blogspot.com ");
     
 }
}


The main() method must have public accessibility so that the interpreter can call it. It is a static method belonging to the class, so that no object of the class is required to start the execution. 

It does not return a value, that is, it is declared void. It always has an array of String objects as its only formal parameter " String args[] " . 

This array contains any arguments passed to the program on the command line .

 All this adds up to the following definition of the main() method.


public static void main(String args[]){
   
 System.out.println("Hello, iam ezcod.blogspot.com ");
     
 }

Post a Comment

Previous Post Next Post

Featured Post