🧠 Java MCQs That Trap Even Experienced Devs 👀
#javamcqs #javareels #staticmethod
🧠 Java MCQs That Trap Even Experienced Devs 👀
1️⃣ Can constructors be overridden?
❌ NO — constructors aren’t inherited
Reason:
Constructors are not inherited, so they cannot be overridden.
Overriding works only with inherited methods.
2️⃣ What if a method is final?
❌ Cannot be overridden (but can be inherited)
Reason:
A final method can be inherited, but cannot be overridden by child classes.
3️⃣ Calling static method using null reference?
😈 Still works! → Output: Static
Reason:
• show() is a static method
• Static methods are called using class reference, not object
• JVM converts it to: Test.show();
So no NullPointerException occurs.
🤯 One static rule saves you from NPE
💬 Comment your score: 0/3 | 1/3 | 2/3 | 3/3
👥 Tag a friend who expects NullPointerException 😅
❤️ Save this for interview revision
➡️ Follow for daily Java MCQs & placement prep
#JavaMCQs #JavaReels #StaticMethod #FinalKeyword #ConstructorInJava #CodingReels #LearnJava #JavaInterview #PlacementPreparation #DeveloperLife 🚀
Comments
Comments from the original post on Instagram
No comments yet
