Question 138

The correct signature of the main method in Java is:

  1. Astatic int main(String args)
  2. Bpublic static void main(String[] args)
  3. Cvoid main(String args[]) private
  4. Dpublic void main()
Show answerHide answer

Correct answer: (B) public static void main(String[] args)

Explanation

It must be public, static, void and take a String array.

From DSSSB TGT Computer Science Full Mock Test 4

This is question 138 of DSSSB TGT Computer Science Full Mock Test 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.