Java Full Course Complete Notes
Java Full Course Complete Notes
1. Introduction to Java
System.out.println("Hello, World!");
- Example:
int x = 10;
float pi = 3.14f;
5. Operators
- Arithmetic: +, -, *, /, %
- Unary: ++, --
- Example:
System.out.println(i);
7. Methods in Java
- Syntax:
returnType methodName(parameters) {
// body
}
- Method overloading: Same method name, different parameters.
8. Arrays
- Syntax:
- Multi-dimensional arrays:
- Class:
class Car {
String model;
void drive() {}
- Object:
10. Constructors
11. Inheritance
- Allows a class to inherit fields and methods from another class.
12. Polymorphism
13. Abstraction
- Abstract class:
- Interface:
interface Vehicle {
void run();
14. Encapsulation
try {
int result = 10 / 0;
} catch (ArithmeticException e) {
- Example:
writer.write("Hello");
writer.close();
17. Packages
- Example:
- Lambda Expressions
- Streams API
- Functional Interfaces
- Java is case-sensitive.