Govt Exams
Garbage collection in Java is non-deterministic. System.gc() is just a request, not a guarantee. Objects are eligible for GC when unreachable, but actual collection timing varies.
Static variables are initialized only once when the class is first loaded into memory, regardless of object creation.
The 'super' keyword is used to refer to parent class members and invoke parent class constructors.
Private members are not inherited. They remain accessible only within the class they are declared in.
x++ returns 5 (then increments to 6), ++x increments to 7 and returns 7. Sum = 5+7 = 12. Note: Actual result may vary due to JVM optimization but typically 11 or 12.
Static variables are shared among ALL instances of a class, not individual copies per object.
Following operator precedence: 5%2=1, 3*2=6, then 1+6-1=6
Variable names can contain letters, digits, underscores, and dollar signs, but cannot start with a digit or contain hyphens or dots.
Constructors can be overloaded based on parameter count and types, but not on return type.
'const' is not a Java keyword. The correct convention for constants is public static final. Option D also works but C follows the standard convention.