iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.1Easy

Which of the following is the correct syntax to declare a variable in Java?

Q.2Easy

Which keyword is used to create a constant variable in Java?

Q.3Easy

What will be the output of the following code? int x = 5; x += 3; System.out.println(x);

Q.4Easy

What will be the output of: boolean flag = true; System.out.println(!flag);

Q.5Easy

What will be the output of: System.out.println();

Q.6Easy

Which keyword is used to prevent a class from being inherited?

Q.7Easy

Which of the following is a valid variable name in Java?

Q.8Easy

What will be printed? float f = 5.5f; System.out.println(f);

Q.9Easy

Which of the following is the correct syntax for a multi-line comment in Java?

Q.10Easy

What will be the output: String s = "Hello"; System.out.println(s.charAt(1));

Q.11Easy

What will be the output of: System.out.println(Math.max(5, 10) - Math.min(3, 8));

Q.12Easy

Which of the following is NOT a valid Java identifier?

Q.13Easy

Which keyword is used to prevent method overriding in Java?

Q.14Easy

Which of the following statements about Java packages is correct?

Q.15Easy

What is the correct way to declare a constant in Java?

Q.16Easy

Which of the following is a valid variable declaration?

Q.17Easy

What does the 'super' keyword do in Java?

Q.18Easy

What is the purpose of the 'instanceof' operator?

Q.19Easy

What will be the output of: System.out.println();

Q.20Easy

Consider the code: int x = 5; x += 3; What is the value of x?