Govt. Exams
Entrance Exams
Private members are not inherited. They remain accessible only within the class they are declared in.
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
Constructors can be overloaded based on parameter count and types, but not on return type.
protected allows access within the same package and to subclasses even outside the package.
== compares object references (memory location), while .equals() compares the actual string content.
'this' is a reference to the current object instance. It's used to distinguish instance variables from parameters and to call other constructors.
Explicit casting from double to int truncates the decimal part. 5.7 becomes 5 (not rounded).
Ternary operator: condition ? trueValue : falseValue. Since 10 > 20 is false, "B" is printed.
Both syntaxes are valid in Java for declaring 2D arrays. The brackets can be placed after the type or variable name.