Multiple choice

Which of the following is the correct format of a Java program?

  1.   class abc {
       Public static void main(String args[]) {……………}
      }
    
  2.   class abc {
       public Static void main(String args[]) {……………}
      }
    
  3.   class abc {
       Public static void Main(String args[]) {……………}
      }
    
  4.   class abc {
       public static void main(String args[]) {……………}
      }
    
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The correct format for a Java program is as follows: class abc { public static void main(String args[]) { …………… } } Here, the keywords class, public and static must be in lower case. String is the class name.