Question 55Asked in DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3

Which of the following statement(s) is/are correct regarding java programming?

Which of the following statement(s) is/are correct regarding java programming? I. Place a semicolon immediately after a method header. II. Define a method outside the braces of a class definition.
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (D) Neither I nor II

Explanation

Both are common errors: a semicolon after a method header ends the declaration, and in Java every method must be defined inside the class body braces. Neither statement is correct.

From DSSSB TGT Computer Science PYQ (Technical), 1 Aug 2021, Shift 3

This is question 55 of DSSSB TGT Computer Science PYQ (Technical), 1 Aug 2021, Shift 3. 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.