0% found this document useful (0 votes)
11 views3 pages

Java_Summary_Notes

This document provides quick revision notes on Java, covering key concepts such as classes, objects, methods, method overloading, constructors, type conversion vs type casting, access specifiers, platform independence, and immutable strings. It also highlights the importance of object-oriented programming in web applications and explains wrapper classes, boxing, and unboxing. The notes conclude with essential formulas for quick reference on OOP principles and Java rules.

Uploaded by

pps201003
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)
11 views3 pages

Java_Summary_Notes

This document provides quick revision notes on Java, covering key concepts such as classes, objects, methods, method overloading, constructors, type conversion vs type casting, access specifiers, platform independence, and immutable strings. It also highlights the importance of object-oriented programming in web applications and explains wrapper classes, boxing, and unboxing. The notes conclude with essential formulas for quick reference on OOP principles and Java rules.

Uploaded by

pps201003
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/ 3

JAVA QUICK REVISION NOTES

1. Class, Object, Method

- Class: Blueprint for creating objects.

Example: class Car { String color; void drive() { } }

- Object: Instance of a class.

Example: Car myCar = new Car();

- Method: Block of code to perform a task.

Example: void drive() { System.out.println("Driving"); }

2. Method Overloading

- Same method name, different parameters.

- Possible for: Constructors, Static Methods, Final Methods.

Example:

void add(int a, int b);

void add(double a, double b);

3. Constructors

- Special method to initialize objects.

- Types: Default, Parameterized, Copy Constructor (manual).

- Rule: Cannot be static or final.

4. Type Conversion vs Type Casting

Type Conversion: Automatic, by compiler.

Type Casting: Manual, by programmer.


Examples:

Type Conversion -> int to double automatically.

Type Casting -> double to int manually.

5. Access Specifiers

public: Everywhere

private: Inside the class

protected: Same package + subclasses

Default: Same package only

6. Platform Independence (Java)

- Compiles to Bytecode.

- JVM executes Bytecode on any OS.

- "Write Once, Run Anywhere".

7. Static, Final and Main Method

- public static void main(String args[])

- public: Accessible everywhere.

- static: No object needed.

- void: No return.

- Main must be static.

8. Web Application Language Choice

- Prefer Object-Oriented Programming (OOP).

- Modular, Secure, Maintainable, Scalable.


9. Immutable String in Java

- String cannot be changed once created.

- Reason: Security, Thread Safety, Memory Efficiency.

Example:

String s = "Hello";

s = "World"; // New object created.

10. Wrapper Classes, Boxing & Unboxing

- Wrapper Class: Converts primitive to object.

- Boxing: Integer i = Integer.valueOf(5);

- Unboxing: int a = i.intValue();

QUICK REVISION FORMULAS

- OOP: Class + Object + Method

- Overloading: Same name, different parameters

- Platform Independence: Bytecode + JVM

- Constructor Rule: No static or final

- Access Specifiers: Public > Protected > Default > Private

ALL THE BEST FOR YOUR EXAMS!

You might also like