Java Notes
What is Java?
Java is a high-level, object-oriented programming language developed by Sun Microsystems and
now owned by Oracle Corporation. It follows the principle 'Write Once, Run Anywhere'.
How Java Works
Java code is written in .java files, compiled into bytecode, and executed on the Java Virtual
Machine (JVM), making it platform independent.
Key Features
Object-Oriented, Platform Independent, Secure, Robust, Multithreading support.
Basic Program
class Hello { public static void main(String[] args) { [Link]('Hello World'); } }
Data Types
Primitive: int, float, char, boolean. Non-Primitive: String, Arrays, Classes.
Control Statements
Conditional (if-else) and loops (for, while) are used to control program flow.
OOP Concepts
Class & Object, Encapsulation, Inheritance, Polymorphism.
Exception Handling
Handled using try-catch blocks to avoid program crashes.
Applications
Used in Android apps, web development, enterprise systems, and banking applications.
Why Learn Java?
High demand, strong OOP foundation, widely used in industry.