Important Java Interview Questions (Based on
Your Topics)
Variables & Data Types
1 What is a variable in Java?
2 What are primitive data types?
3 Difference between primitive and non-primitive types.
4 What is type casting?
5 Difference between widening and narrowing.
Operators & Conditions
1 What are relational operators?
2 What are logical operators?
3 Difference between logical and relational operators.
4 What is if-else statement?
5 When do we use nested if?
Loops & Patterns
1 What is a loop?
2 Difference between for and while loop.
3 Difference between while and do-while.
4 What is an infinite loop?
5 When do we use nested loops?
Methods
1 What is a method?
2 What is method overloading?
3 Rules of method overloading.
4 Difference between static and instance method.
5 What is recursion?
Constructors & this
1 What is a constructor?
2 Rules of constructor.
3 What is constructor overloading?
4 What is constructor chaining?
5 Uses of this keyword.
OOP Basics
1 What is inheritance?
2 Why do we use inheritance?
3 What is method overriding?
4 Difference between overloading and overriding.
5 What is factory method?
Memory & Objects
1 What is an abandoned object?
2 When object becomes eligible for GC?
3 Difference between stack and heap.
4 What is garbage collection?
5 What is object creation?
Access & Packages
1 What are access modifiers?
2 Difference between public and private.
3 What is protected?
4 What is default access?
5 What is a package?
Control Transfer
1 What are control transfer statements?
2 What is break?
3 What is continue?
4 What is return?
5 Difference between break and continue.