What is a Class & Object?

A Class is a user defined datatype. Class is a structure representing the data & it's related function.


Class will act as the base for Encapsulation & we would be implementing the concept of Encapsulation through Object.

(NOTE):
Any java application looks like collection of classes.(In java everything should be present in the form of an encapsulated manner, thus everything should present inside the class nothing should present inside the Class nothing should present outside the Class.

But whereas "C" application looks like collection of function.


Object is an instance of a Class. The Memory space allocated for the members of a Class dynamically at the runtime is known as Object.

Object would be representing the data of a Class in the RAM.

No comments:

Post a Comment