Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects that contain data (fields) and behavior (methods). It focuses on designing software that closely represents real-world entities.
Characteristics of OOP

Java Data Types
Java data types define the type of data a variable can store in a program. They help the compiler allocate memory efficiently and ensure type safety. Java provides two main categories: primitive and non-primitive data types.

Class
A Class in Java is a blueprint or template used to create objects. It defines the properties (data) and behaviors (methods) that objects of that class will have.
- A class is a user-defined data type.
- It contains variables (fields) and methods.
- Multiple objects can be created from a single class. Example: A Car represents a class (blueprint), while BMW, Mercedes, and Audi represent objects (instances) created from that class. Object An Object in Java is an instance of a class that represents a real-world entity. It is used to access the variables and methods defined inside a class. Example: Dog is a class, Tommy is an object of that class.
public class Home
{
static String name="Ezhil";
static int homeAge=15;
public static void main(String[] args)
{
System.out.println(Home.name);
System.out.println(Home.homeAge);
}
}
O/P:
Ezhil
15
References
https://www.geeksforgeeks.org/java/object-oriented-programming-oops-concept-in-java/
https://www.geeksforgeeks.org/java/java-data-types/
Top comments (0)