Core Java – Handwritten Style Notes
1. Introduction to Java
• High-level, object-oriented, platform-independent language.
• Compilation: .java → bytecode (.class) → executed by JVM.
• JDK (tools), JRE (runtime), JVM (execution engine).
• Features: WORA, secure, robust, multithreaded.
2. Operators
• Arithmetic: + - * / %
• Relational: == != > < >= <=
• Logical: && || !
• Assignment: = += -=
• Unary: ++ --
• Bitwise: & | ^ ~
3. Data Types
• Primitive: int, float, double, char, boolean, byte, short, long.
• Non-Primitive: String, Array, Class, Interface.
• Primitive → fixed size, Non-primitive → reference type.
4. Variables
• Local: inside method, must initialize.
• Instance: per object.
• Static: shared among all objects.
5. Arrays
• Collection of same data type elements.
• Fixed size, index starts at 0.
• Types: 1D, 2D arrays.
6. Control Statements
• Decision: if, if-else, switch.
• Loops: for, while, do-while.
• Jump: break, continue.
7. Methods & Classes
• Class: blueprint of objects.
• Object: instance of class.
• Method: performs task.
• Concepts: constructor, method overloading.
8. Inheritance
• Acquire properties of parent class.
• Types: single, multilevel, hierarchical.
• Supports method overriding.
9. Package & Interface
• Package: group of related classes.
• Interface: abstract methods, multiple inheritance.
10. Exception Handling
• Handles runtime errors.
• Keywords: try, catch, finally, throw, throws.
• Types: checked, unchecked.
11. Multithreading
• Multiple threads run simultaneously.
• Thread creation: Thread class, Runnable interface.
• Lifecycle: New → Runnable → Running → Dead.
12. I/O
• Input and output operations using streams.
• Classes: FileReader, FileWriter, BufferedReader.
13. Java Applet
• Small program for browser GUI.
• Now obsolete.
14. String Handling
• Immutable sequence of characters.
• Methods: length(), charAt(), substring(), toUpperCase(), toLowerCase().