nerdexam
GIAC

GSSP-JAVA · Question #85

Mark works as a Programmer for InfoTech Inc. He develops the following program. class iftest2 {public static void main(String args[]) {int x=0, y=1;if //code//{System.out.println("true");}}} Which…

The correct answer is A. (y == true) B. (1) C. (x == false) E. (x). See the full explanation below for the reasoning.

Question

Mark works as a Programmer for InfoTech Inc. He develops the following program. class iftest2 {public static void main(String args[]) {int x=0, y=1;if //code//{System.out.println("true");}}} Which of the following if statements are illegal if they are placed at //code//?

Options

  • A(y == true)
  • B(1)
  • C(x == false)
  • D(x == 1)
  • E(x)
  • F(x != y)

How the community answered

(24 responses)
  • A
    79% (19)
  • D
    8% (2)
  • F
    13% (3)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice