JAVA COMPLETE NOTES (BASIC TO ADVANCED)
1. Introduction to Java
Java is a high-level, object-oriented, platform-independent programming language.
Features: Simple, OOP, Platform Independent, Secure, Robust, Multithreaded.
2. JVM, JRE, JDK
JVM: Executes bytecode.
JRE: JVM + Libraries.
JDK: JRE + Development tools.
3. Data Types
Primitive: byte, short, int, long, float, double, char, boolean.
Non-Primitive: String, Array, Class, Interface.
4. Control Statements
if, if-else, switch, for, while, do-while, break, continue.
5. Arrays
Used to store multiple values of same type.
Single & Multi-dimensional arrays.
6. OOP Concepts
Encapsulation: Binding data and methods.
Inheritance: Reusing parent class properties.
Polymorphism: Method overloading & overriding.
Abstraction: Hiding implementation using abstract class/interface.
7. String Handling
String: Immutable.
StringBuilder: Mutable, not thread-safe.
StringBuffer: Mutable, thread-safe.
8. Exception Handling
try, catch, finally, throw, throws.
Checked & Unchecked exceptions.
9. Collections Framework
ArrayList, HashSet, HashMap.
10. Multithreading
Thread class & Runnable interface.
Synchronization.
11. File Handling
File, FileReader, FileWriter, BufferedReader.
12. Java 8 Features
Lambda expressions, Streams, Functional interfaces.
13. JDBC
Connecting Java with database.
14. Important Interview Tips
Prefer StringBuilder over String for modifications.
Use HashMap for fast lookup.
Always close resources.