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.21Medium

What is the difference between == and .equals() for String comparison?

Q.22Medium

Which access modifier allows access within the same package and subclasses?

Q.23Medium

Which statement about constructor overloading is true?

Q.24Medium

What is the output of: System.out.println(5 % 2 + 3 * 2 - 1);?

Q.25Medium

Which of the following about static variables is incorrect?

Q.26Medium

Which of the following cannot be inherited in Java?

Q.27Medium

Consider: class A { static int x = 5; } How many times is x initialized when you create multiple A objects?

Q.28Medium

What is the scope of a variable declared inside a method in Java?

Q.29Medium

Which of the following will result in a compilation error? class Test { public void method1() { } public void method1(int x) { } }

Q.30Medium

What is the output of: System.out.println(true && false || true);

Q.31Medium

Which statement about method parameters is correct?

Q.32Medium

What is the difference between == and equals() in Java?

Q.33Medium

Consider: String s1 = "Java"; String s2 = new String("Java"); System.out.println(s1 == s2);

Q.34Medium

Which of the following is a feature of Java 8 that allows functional programming?

Q.35Medium

What is the purpose of the 'this' keyword in Java?

Q.36Medium

Which of the following correctly demonstrates method overloading?

Q.37Medium

Which of the following statements about static methods is correct?

Q.38Medium

What will happen if you try to access an index out of bounds in an array?

Q.39Medium

Which access modifier allows a member to be accessible only within the same package?

Q.40Medium

What is the difference between 'break' and 'continue' in loop statements?

Java Programming MCQs – Free Practice Test | iGET | iGET