0% found this document useful (0 votes)
6 views2 pages

Java All Topics Notes

The document provides an overview of Java programming fundamentals, including its basic syntax, data types, control statements, and object-oriented programming concepts. It covers essential topics such as type casting, exception handling, collections framework, multithreading, and file handling. Each section outlines key features and functionalities, making it a comprehensive guide for Java learners.

Uploaded by

kengarswa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Java All Topics Notes

The document provides an overview of Java programming fundamentals, including its basic syntax, data types, control statements, and object-oriented programming concepts. It covers essential topics such as type casting, exception handling, collections framework, multithreading, and file handling. Each section outlines key features and functionalities, making it a comprehensive guide for Java learners.

Uploaded by

kengarswa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Java Basics
- Java is a high-level, class-based, object-oriented programming language.
- It follows the WORA principle – Write Once, Run Anywhere.
- Main method: public static void main(String[] args)

2. Data Types, Variables, Operators


- Primitive Data Types: byte, short, int, long, float, double, char, boolean
- Variables must be declared with a type before use.
- Operators include arithmetic (+, -, *, /, %), relational (==, !=), logical (&&, ||, !), etc.

3. Type Casting
- Widening Casting: byte -> short -> int -> long -> float -> double
- Narrowing Casting: double -> float -> long -> int -> short -> byte
- Syntax: int i = (int) 10.5;

4. Control Statements
- if, if-else, switch-case for decision making
- Loops: for, while, do-while

5. Arrays
- One-dimensional array: int[] arr = new int[5];
- Two-dimensional array: int[][] matrix = new int[3][3];

6. Strings and StringBuilder


- String is immutable, use StringBuilder for mutable strings.
- String methods: length(), charAt(), substring(), indexOf(), etc.

7. OOPs Concepts
- Class and Object
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation

8. Constructors & Overloading


- Constructors are used to initialize objects.
- Constructor overloading: multiple constructors with different parameters.
9. Method Overloading & Overriding
- Overloading: same method name with different parameters (compile-time).
- Overriding: subclass provides specific implementation (runtime).

10. Exception Handling


- try-catch-finally blocks handle exceptions.
- throw and throws for custom exceptions.
- Checked vs Unchecked exceptions.

11. Collections Framework


- Interfaces: List, Set, Map, Queue
- Classes: ArrayList, LinkedList, HashSet, TreeSet, HashMap, TreeMap
- Use Comparable and Comparator for sorting.

12. Multithreading
- Thread class and Runnable interface
- Thread lifecycle: New, Runnable, Running, Blocked, Terminated
- Synchronization, wait(), notify(), notifyAll()

13. File Handling


- Reading with FileReader and BufferedReader
- Writing with FileWriter and BufferedWriter
- NIO: Files.readAllLines(path), Files.write(path, data)

You might also like