F Also S
F Also S
headings:
private ✅ ❌ ❌ ❌
default ✅ ✅ ❌ ❌
❌ (only through
protected ✅ ✅ ✅
inheritance)
public ✅ ✅ ✅ ✅
7. Default values:
boolean: false
int: 0
Object: null
Precisio
~7 digits ~15 digits
n
Featur
float double
e
int → Integer
boolean → Boolean
char → Character
double → Double, etc.
🔧 Variables in Java
11. Types of variables:
int is a primitive.
Integer is a wrapper class (object) for int.
✍️Coding Standards
22. Common coding/naming conventions:
Single
Multilevel
Hierarchical
❌ Java does not support multiple inheritance with classes
Inheritance (Car is a
is-a Car extends Vehicle
Vehicle)
"is-a" "has-a"
class
Tightly
Flexible
coupled
❌ No. But the child class can call the parent constructor using
super().
Let me know if you want these in PDF format or MCQ quiz form to revise easily!
Great! Let's continue with more core Java OOP and concept questions — I’ll keep each
answer short and clear:
🔄 Polymorphism in Java
36. What is Polymorphism?
Compile
When? Runtime
time
Overloaded → ✅ Yes
Overridden → ❌ No (they are hidden, not overridden)
Constructors Yes ❌ No
Multiple
❌ No (single class) ✅ Yes (multiple interfaces)
inherit?
42. When to use abstract class?
Encapsulation
44. What is Encapsulation?
🚫 Exception Handling
45. What is an exception?
Current class
this
instance
📂 Miscellaneous
54. What is the Java Virtual Machine (JVM)?
Java Runtime
JRE JVM + libraries
Environment
JRE + compiler +
JDK Java Development Kit
tools
Prevents:
o Variable from being reassigned
o Method from being overridden
o Class from being extended
Absolutely! Let’s continue with more Java interview and concept questions to strengthen
your fundamentals:
Operato
Compares Used for
r
🧹 Garbage Collection
64. What is garbage collection?
You can request using System.gc(), but JVM may ignore it.
🔁 Control Flow
66. Types of loops in Java:
for
while
do-while
Enhanced for-each (for arrays and collections)
✅ Slow if many
String ❌
(immutable) changes
StringBuilder ✅ ❌ Fast
Slower than
StringBuffer ✅ ✅
Builder
📦 Collections Framework
71. What is a Collection?
Access Fast
Slow
speed (indexing)
Insert/ Faster at
Slower
delete ends
Unordere
Order Sorted
d
(a, b) -> a + b;
Inheritance vs
One for extending, one for behavior
Interface