OOP stands for Object Oriented Programming. In Java, we create classes to represent different things. For instance:
public class MyClass {
public static void main(String args[]) {
Car cr = new Car();
cr.createCar("Ford", "Green", 2000);
cr.printInfo();
}
}
class Car{
private String model, color;
private int year;
void createCar(String md, String cl, int yr){
model = md;
color = cl;
year = yr;
}
void printInfo(){
System.out.println("Car Info:");
System.out.println("Model: "+model);
System.out.println("Color: "+color);
System.out.println("Year: "+year);
}
}
We create a car object derived from the Car class with whatever properties we want and then we can display the properties of our car with the printInfo() method.
This is just one example of the OOP concept of Java.