☕ Java Beginner

What is an object in Java?

Answer

An object is a runtime instance of a class. While a class is the blueprint, an object is the actual entity created from that blueprint — it occupies memory in the heap and has its own copy of the class's instance fields. You create an object with the new keyword: Car myCar = new Car();. Objects have three key characteristics: state (the current values of its fields), behavior (the methods it can execute), and identity (a unique reference/address in memory). In Java, objects are always accessed through references — you never manipulate the object directly.