1. Default value of an uninitialized instance boolean field is:
Instance fields get defaults; locals don’t. boolean defaults to false.
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Java · Question Set
Core Java & JVM Basics interview questions for placements and exams.
Questions
14
Included in this set
Subject
Java
Explore more sets
Difficulty
Mixed
Level of this set
Go through each question and its explanation. Use this set as a focused practice pack for Java.
Instance fields get defaults; locals don’t. boolean defaults to false.
For complete preparation, combine this set with full subject-wise practice for Java. You can also explore other subjects and sets from the links below.
Both must be the first statement. this(...) chains within the same class; super(...) calls parent ctor. Only one can appear, and compiler inserts implicit super() if none provided.
final modifies classes/methods/variables; finally executes regardless of exception; finalize() is legacy GC callback (discouraged).
private: class only; default: package; protected: package + subclasses (even cross-package via inheritance); public: everywhere.
Stable hashCode/equality avoids map/key corruption; no internal state changes simplify reasoning and eliminate data races.
Parent-first delegation ensures core classes loaded by bootstrap are trusted, preventing malicious shadowing; custom loaders typically delegate up before defining classes.
javac produces bytecode; the platform-specific JVM interprets/JIT-compiles it, enabling WORA.
JRE contains the JVM and core libraries; JDK bundles JRE plus compilers and tooling.
Each thread has its own JVM stack containing frames for method execution.
Literals are interned in the String pool; identical literals share one instance. new String creates a distinct heap object even if an equal literal exists.
Unboxing a null Integer to int throws NPE; wrappers are immutable and live on heap.
The JIT compiles frequently executed methods/loops to native code for speed.
JVM searches for a public static void main(String[]). Varargs are allowed but return must be void.
Statics load top-down in hierarchy, then per-instance initialization proceeds super→sub.