Java Programming Notes
1. Introduction to Java
- Java is a high-level, object-oriented programming language.
- Developed by Sun Microsystems (now owned by Oracle).
- Platform-independent via Java Virtual Machine (JVM).
2. Basic Syntax
- Every Java application starts with a class definition.
- The main method: public static void main(String[] args)
- Statements end with a semicolon (;).
3. Data Types
- Primitive types: int, float, double, char, boolean, byte, short, long.
- Reference types: Strings, Arrays, Objects.
4. Variables
- Declaration: int num;
- Initialization: int num = 10;
- Constants: final int MAX = 100;
5. Operators
- Arithmetic: +, -, *, /, %
- Relational: ==, !=, >, <, >=, <=
- Logical: &&, ||, !
6. Control Statements
- if, if-else, switch
- loops: for, while, do-while
- break and continue
7. Object-Oriented Concepts
- Class and Object
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
8. Exception Handling
- try, catch, finally, throw, throws
- Common exceptions: NullPointerException, ArrayIndexOutOfBoundsException
9. File Handling ([Link] package)
- FileReader, BufferedReader for reading files
- FileWriter, BufferedWriter for writing files
10. Packages and Imports
- Package: group of related classes.
- import [Link];
11. Java APIs
- [Link]: ArrayList, HashMap, Collections
- [Link]: Math, String, System
12. Java Development Tools
- javac: Java compiler
- java: Java interpreter
- IDEs: Eclipse, IntelliJ IDEA, NetBeans
13. GUI (Graphical User Interface)
- AWT, Swing for desktop applications
- JFrame, JButton, JLabel for UI elements
14. Multithreading
- Thread class and Runnable interface
- Synchronization and inter-thread communication
15. JavaFX (Modern GUI Framework)
- Used for building rich desktop applications
--- End of Notes ---