Interview Q&A / Java

INTERVIEW Q&A · 72 QUESTIONS

Java interview questions

Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.

  1. How do you create a custom exception in Java?

    Extend Exception for a checked custom exception or RuntimeException for an unchecked one, and add constructors that pass the message and optionally a cause to the parent. Use it to express a business rule clearly.

    BeginnerQuick answer1 min read