DEV Community

Pavitra Aravind
Pavitra Aravind

Posted on

Object & class definition in java...

Object

An object is a real-world entity that is used for unique representation. It has a certain behavior, state, and identity.

An object is known as an "instance of a class".

They are physical entities.

Objects are created using the "new" keyword.

It consumes some memory space.

create objects as many times as we ecording to our requirements.

Class

A Class is a collection of similar types of objects. Classes are composed of names, attributes, and methods.

A class is known as "a blueprint of an object"

They are logical entities.

Classes are created using the "class" keyword.

It does not occupy any memory space.

We can create a class only once.

Top comments (0)