Java One-Shot Concept Notes (Interview Ready)
1. Java Basics
• Java is Object Oriented, Platform Independent (WORA)
• JDK: Development Kit, JRE: Runtime, JVM: Executes bytecode
2. OOP Concepts
Encapsulation – Data hiding using private variables
Inheritance – One class acquires another class properties
Polymorphism – One object many forms (Overloading / Overriding)
Abstraction – Hiding implementation details
3. Interface
• Supports multiple inheritance
• Methods are public & abstract by default
• Used heavily in Selenium (WebDriver)
4. Abstract Class
• Can have abstract & non-abstract methods
• Partial abstraction
5. String
• Immutable
• Stored in String pool
• equals() compares content, == compares reference
6. Exception Handling
• Checked & Unchecked Exceptions
• try-catch-finally
• throw vs throws
7. Collections Framework
List – Allows duplicates (ArrayList, LinkedList)
Set – No duplicates (HashSet, LinkedHashSet, TreeSet)
Map – Key-Value pair (HashMap, LinkedHashMap, TreeMap, Hashtable)
8. Map Differences
HashMap – 1 null key, unordered
LinkedHashMap – insertion order
TreeMap – sorted order, no null key
Hashtable – synchronized, no null key/value
9. Multithreading
• Thread class / Runnable interface
• Synchronization avoids data inconsistency
10. Java 8 Features
• Lambda expressions
• Stream API
• Functional Interfaces
11. Selenium Related Java
• WebDriver is interface
• ChromeDriver is implementation
• POM uses Encapsulation & Abstraction
12. Logging
• Log4j used instead of [Link]()
• Supports log levels & file logging
Interview Tip:
Focus on real-time usage, not definitions only.