What are Classes and Objects?

A class is a LOGICAL UNIT or BLUEPRINT. It contains fields, methods and properties.
Object - An object is an INSTANCE of a class.

In object-oriented programming (OOP), classes and objects are fundamental concepts that allow you to model real-world entities and their behaviors in a program.


Class members are:

1. A constructor is a method in the class which gets executed when a class object is created.
2. A field is a variable of any type. It is basically the data.
3. A property is a member that provides helps in read and write of  private field.
4. A method is a code block that contains a series of statements. 


 

Post a Comment

Previous Post Next Post