Java Finally Block Interview Trap

🚨 Java Interview Trap You Should Know Here’s a small snippet that can trip up even experienced developers: public class TestFinally { public static void main(String[] args) { System.out.println(check()); } static int check() { try { return 10; } finally { return 20; } } } 🤔 What do you think the output will be? #Java #InterviewPrep #Coding #SoftwareEngineering #Developers

To view or add a comment, sign in

Explore content categories