Interview Q&A / Java
Java interview questions
Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.
Prefer rapid revision? Practise Java short interview answers →
- 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