What are objects and classes in OOPs programming?

What are objects and classes in OOPs programming?

Last updated:8/23/2021 7:02:01 AM

1 Answers

Ashutosh Kumar Verma
Ashutosh Kumar Verma

Objects-

    Objects are the real world entity that exists in the world (ex- Ball, Pen, Paper, Book, Toys, etc.). But in the programming language an object is the instance of the class. It defines the behavior and characteristics of class. There can be one or more than one objects are created of a class in a program. It consumes the memory space when it created.

Class-

    A class is a container which contain the fields, methods and properties. A class is logical entity type because it does not consume memory space when it created and also does not exists in real world. Class can creates its own objects to execute their statements in program. 

    There are generally 4 types of class is created in programming language i.e.

1- Abstract class (by using 'abstract' keyword).

2- Static class (by using 'static' keyword).

3-Sealed class (by using 'sealed' keyword).

we can say one more type of class 'Regular class' which declare without any keyword except 'class' keyword.

4- Partial class (by using 'partial' keyword).


Answer