Java Programming MCQs — Programming

3 practice MCQs

The correct answer is marked on every question, with its full explanation.

ProgrammingJava Programming PPSC FPSC NTSID: NWF-036

What is the output of this Java code? int[] arr = {1, 2, 3}; System.out.println(arr.length);

  1. A3 ✓ Correct answer
  2. B2
  3. C4
  4. D0
ProgrammingJava Programming PPSC FPSC NTSID: PROG-004

What is the output of this Java code? System.out.println(5 + 3 * 2);

  1. A11 ✓ Correct answer
  2. B16
  3. C10
  4. D8
ProgrammingJava Programming PPSC FPSC NTSID: PROG-009

What is the output of this Java code? System.out.println(10 - 4);

  1. A2
  2. B14
  3. C6 ✓ Correct answer
  4. D40

Practise these MCQs interactively →

← Programming MCQs