issue 117apr 27mmxxvi
est. 2017
Sun, 27 Apr 2026
vol. IX · no. 117
PapersAdda
placement intelligence, since 2017
640+ briefs · 24 campuses · by reservation
verified offers · sourced from r/developersIndia
razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1

Java Exception Handling Interview Questions 2026: 26 Q&A

10 min read
Interview Questions
Updated: 8 Jun 2026
Aditya Sharma
Aditya's Edit

PapersAdda 2026 Placement Cycle

By Aditya Sharma·Founder & Editor, PapersAdda

What changed in 2026 drives

Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.

What I'd actually study for this

  • 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
  • 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
  • 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
  • 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken

Where most candidates trip up

The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.

Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.

Last Updated: June 2026 | Level: Freshers to Mid-Level | Read Time: ~15 min

Exception handling is a guaranteed topic in Java interviews. Candidates report that interviewers love the checked-versus-unchecked distinction, the finally plus return trap, and custom exception design. This guide covers 26 questions with full answers, runnable code, and the gotchas interviewers use to separate rote learners from people who understand control flow. Behaviour reflects the official Oracle Java tutorials; confirm spec-level details against JLS chapter 11.

Pair this with Java Interview Questions 2026 and Java OOPs Interview Questions 2026.


Table of Contents

  1. Fundamentals (Q1 to Q9)
  2. Control Flow and finally (Q10 to Q16)
  3. Custom and Advanced (Q17 to Q22)
  4. Best Practices (Q23 to Q26)
  5. Predict the Output
  6. Exception Hierarchy Table
  7. Frequently Asked Questions

Fundamentals

Q1. What is an exception in Java? Easy


Q2. What is the difference between an error and an exception? Easy


Q3. What is the difference between checked and unchecked exceptions? Medium

TypeExamplesCompile-time check
CheckedIOException, SQLExceptionYes
UncheckedNullPointerException, ArrayIndexOutOfBoundsExceptionNo
ErrorOutOfMemoryError, StackOverflowErrorNo

Q4. What is the exception hierarchy in Java? Easy


Q5. What is the difference between throw and throws? Easy


Q6. Can a try block exist without a catch? Medium


Q7. Can you catch multiple exceptions in one catch? Medium

try { risky(); }
catch (IOException | SQLException e) { log(e); }

Q8. What is exception chaining? Medium

catch (SQLException e) {
    throw new DataAccessException("query failed", e);   // preserves cause
}

Q9. What happens if an exception is not caught anywhere? Medium


Control Flow and finally

Q10. What is the finally block and when does it run? Easy


Q11. Does finally run if there is a return in try? Hard

int test() {
    try { return 1; }
    finally { return 2; }   // overrides; method returns 2
}

Q12. What happens if both try and finally throw exceptions? Hard


Q13. What is try-with-resources? Medium

try (BufferedReader br = new BufferedReader(new FileReader("f.txt"))) {
    return br.readLine();
}   // br.close() called automatically

Q14. What is a suppressed exception? Hard


Q15. Can you have nested try blocks? Medium


Q16. What is the order of catch blocks? Medium


Custom and Advanced

Q17. How do you create a custom exception? Medium

class InsufficientFundsException extends RuntimeException {
    InsufficientFundsException(String msg) { super(msg); }
}

Q18. When should a custom exception be checked vs unchecked? Hard


Q19. What is the difference between final, finally, and finalize? Medium


Q20. Can a constructor throw an exception? Medium


Q21. What happens to an exception thrown in a finally during stack unwinding? Hard


Q22. How does exception handling work with method overriding? Hard


Best Practices

Q23. Why is catching Exception or Throwable broadly bad? Medium


Q24. Why should you not use exceptions for control flow? Medium


Q25. What should you log when handling an exception? Easy


Q26. What is the cost of throwing an exception? Hard


Predict the Output

Snippet 1

public static int f() {
    try { return 1; }
    finally { System.out.println("finally"); }
}
System.out.println(f());

Output:

finally
1

Why: finally runs after the return value (1) is computed but before the method returns, so "finally" prints first, then the returned 1.


Snippet 2

try {
    int[] a = new int[2];
    a[5] = 1;
    System.out.println("after");
} catch (ArrayIndexOutOfBoundsException e) {
    System.out.println("caught");
} finally {
    System.out.println("done");
}

Output:

caught
done

Why: The out-of-bounds write throws before "after" prints, control jumps to the matching catch, then finally always runs.


Snippet 3

public static int g() {
    try { return 1; }
    finally { return 2; }
}
System.out.println(g());

Output:

2

Why: A return inside finally overrides the try's return. The method returns 2, the value 1 is discarded. This is the classic trap question.


Exception Hierarchy Table

LevelClassRecoverableCompile-checked
RootThrowablen/ano
SeriousErrornono
GeneralExceptionyesyes (most)
RuntimeRuntimeExceptionsometimesno

Frequently Asked Questions

What is the most asked exception handling question in 2026?

Candidates report that the difference between checked and unchecked exceptions, and the behaviour of finally when try has a return, are the two most repeated questions in Java rounds.

Is try-with-resources important for interviews?

Yes. Interviewers expect you to use try-with-resources for any closeable resource and to explain that it auto-closes in reverse order of declaration and suppresses secondary exceptions rather than masking the primary one.

Can finally override a return value?

Yes, and it is a known trap. A return inside finally overrides any return or exception from try or catch, which is exactly why returning from finally is considered bad practice.

What is the difference between final, finally, and finalize?

final is a modifier for constants and non-overridable members, finally is the always-run block after try, and finalize is a deprecated pre-GC hook you should never rely on. Interviewers ask this to test attention to detail.

Should custom exceptions be checked or unchecked?

Make it checked when the caller can recover and you want to force handling; make it unchecked for programming errors or unrecoverable conditions. Modern codebases often lean unchecked to keep method signatures clean.



Confirm any spec-level exception semantics against the official JLS and Oracle tutorials before your interview. This guide reflects candidate-reported patterns and public preparation resources as of June 2026.

Methodology applied to this articlelast verified 8 Jun 2026
Sources used
Public exam-pattern documents, official recruiter pages, and verified candidate reports on r/developersIndia and LinkedIn.
Verification window
Page last edited 8 Jun 2026 by Aditya Sharma. Numbers and patterns sanity-checked against the most recent 2026 cycle drives we tracked.
What we did NOT do
  • No fabricated salary numbers or success rates. If we quote a range, it's sourced.
  • No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
  • No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Verification policy: /editorial-standards/. Found something incorrect? Submit a correction - we respond within 48 hours.

Explore this topic cluster

More resources in Interview Questions

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

Paid contributor programme

Sat this this year? Share your story, earn ₹500.

First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.

Submit your story →

Ready to practice?

Take a free timed mock test

Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.

Start Free Mock Test →

Related Articles

More from PapersAdda

Share this guide: