Object in Java
Read more »
Object in Java programming language or any other Object oriented programming language like C++ are core of OOPS concept and that's why the name. Classand Object along with Inheritance, Polymorphism, Abstractionand Encapsulationforms basis of any Object oriented programming language e.g. Java. Objects are instances of Class, Class define blue prints and Objects are thing which are created based upon that blueprint. Object are also known as instance in Java, e.g. When we say an instance of String class, we actually mean an Object of String class. Object has state and behaviour in Java. State is represented using instance variable and static variable in Java class and behaviors are implemented using methods in Java. What differentiate two Objects of same class are there state e.g. if we take two instance of String class "A" and "B" there contents are different which is there state. In OOPS programming, we model real world things into Class and Object e.g. Car class is a blue print of car which may specify that car should have 4 gears, 4 seats an engine etc and every single car is an Object or instance of Car class. If you like to learn more on OOPS concepts and designs, I suggest to read 10 OOPS and SOLID design principles in Java, That will also help to improve your OOPS programming.