#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · INSTANT FEEDBACK

Java MCQ Quiz: Core Java Questions for Tests and Interviews

Check your core Java knowledge, from primitives and Strings to collections and exceptions.

  • ☕ 20 questions
  • 📚 Core Java topics
  • 💡 Short explanations

How to use the Java MCQ Quiz

  1. 1. Pick the lengthChoose 10 Java questions or all 20, with shuffle on or off.
  2. 2. Answer each questionTap an option to see at once if it is right, plus a short Java explanation.
  3. 3. See your scoreFinish to get your Java score and a review of all your answers.

What this quiz covers

This quiz covers core Java, the part every Java interview starts with:

  • Language basics: sizes of int and char, default values, integer division and String joining order.
  • Strings: immutability, and equals() vs ==.
  • OOP keywords: final, static, super, overloading vs overriding.
  • Collections: Set vs List, HashMap and null keys, ArrayList vs LinkedList.
  • Exceptions: checked vs unchecked, and when finally runs.
  • Platform: JDK vs JRE vs JVM, the main method and garbage collection.

Worked example and how to use it

Example: What does System.out.println(1 + 2 + "3") print? Java works left to right. First 1 + 2 = 3 (number addition), then 3 + "3" joins as text, so the output is 33. If you write "1" + 2 + 3 instead, it prints 123, because the very first + is already joining text.

Another classic: two Strings with the same text can be different objects, so a == b may be false even when a.equals(b) is true. Always use equals() to compare text.

The output answers were checked with the javac compiler. Tips for Java interviews:

  • Explain why, not just what: for example, why String is immutable (security, caching and thread safety).
  • Know one example of each: a checked exception (IOException) and an unchecked one (NullPointerException).
  • Follow up with the OOPs quiz, since Java questions often lead into OOP design.

Frequently asked questions

Does it include Java 8+ features?

This set focuses on core Java fundamentals. Streams and lambdas are not covered yet.

How hard is it?

Easy to medium, the level of campus placement tests and first-round interviews.

Are answers explained?

Yes, every question has a short explanation, shown right after you answer.

Is it free?

Yes, free. Only your final score asks for your name and WhatsApp number, once for all Uncodemy tools.

More free tools

See all free tools