Core Java – All Topics Detailed Notes
1. Introduction to Java
• Java is a high-level, object-oriented programming language.
• It follows the principle: Write Once, Run Anywhere (WORA).
• Java source code is compiled into bytecode, which runs on JVM.
• Main features: Simple, Secure, Portable, Robust, Architecture-neutral.
2. JVM, JRE, JDK
• JVM (Java Virtual Machine) executes bytecode.
• JRE (Java Runtime Environment) provides libraries and JVM.
• JDK (Java Development Kit) includes compiler, debugger, and JRE.
3. Data Types & Variables
• Primitive data types store simple values.
• Non-primitive data types store references.
• Variables: local, instance, static.
4. Operators
• Arithmetic operators: +, -, *, /, %.
• Relational operators: ==, !=, >, <, >=, <=.
• Logical operators: &&, ||, !.
5. Control Statements
• Decision making: if, if-else, switch.
• Looping: for, while, do-while.
• Jump statements: break, continue.
6. OOP Concepts
• Class is a blueprint of object.
• Object represents real-world entity.
• Inheritance provides code reusability.
• Polymorphism allows method overloading and overriding.
• Encapsulation binds data with methods.
• Abstraction hides implementation details.
7. Constructors
• Constructor initializes objects.
• Types: default, parameterized.
• Constructor name must be same as class name.
8. String Handling
• String is immutable in Java.
• StringBuffer and StringBuilder are mutable.
• StringBuilder is faster than StringBuffer.
9. Arrays
• Array stores multiple values of same type.
• Types: single-dimensional, multi-dimensional.
10. Exception Handling
• Exception is an abnormal condition.
• Keywords: try, catch, finally, throw, throws.
• Checked and unchecked exceptions.
11. Multithreading
• Thread allows concurrent execution.
• Thread creation: Thread class or Runnable interface.
• Synchronization avoids data inconsistency.
12. Collections Framework
• Collection is a group of objects.
• List, Set, Queue, Map interfaces.
• Common classes: ArrayList, LinkedList, HashSet, HashMap.
13. File Handling
• File class is used to handle files.
• Streams: Byte stream and Character stream.
14. Packages & Access Modifiers
• Package groups related classes.
• Access modifiers: public, private, protected, default.
15. Java 8 Features (Intro)
• Lambda expressions.
• Functional interfaces.
• Stream API.