The Object Oriented Programming is a programming model, where we use Class and Object to write the program. Unlike the sequential programming model the variable and methods are contained in Classes and we use Object to use the variable and methods contained by a particular class.
Apart from this OOPS provides many new features, Such as:
1. Inheritance
2. Polymorphism.
3. Encapsulation.
Etc.
Concept Of Class: If we think about Data used in programming we will find there are basically 3 types of data.
1. Primitive Data Type.
2. Derived Data Type.
3. User Defined Data Type.
Primitive Data Type: Primitive Data Types are the data type defined in programming language. For Example: int, char, float.
Derived Data Type: Derived Data Types are the data types derived from primitive data type. For Example: Array.
User Defined Data Type: The User Defined Data Types are such data type where user/programmer defines the data type according to requirement of the program and it will contain one or more primitive or derived data type.
For Example: If we want to represent a student in a program, the student data may contain various attributes. such as Roll No (int), Name(String/Array[Char]), Address(String/Array[Char]) Etc.
So the Student data will be combination of different Primitive and/or Derived Data Type.
This type of data type is called User Defined Data Type.
Example:
Struct, Class are user defined data type.
"So Classes in Object Oriented Programming is an User Defined Data Type defined by programmer or User according to the program requirement, and Objects are the variable of this data type to use the features of the class."
Apart from this OOPS provides many new features, Such as:
1. Inheritance
2. Polymorphism.
3. Encapsulation.
Etc.
Concept Of Class: If we think about Data used in programming we will find there are basically 3 types of data.
1. Primitive Data Type.
2. Derived Data Type.
3. User Defined Data Type.
Primitive Data Type: Primitive Data Types are the data type defined in programming language. For Example: int, char, float.
Derived Data Type: Derived Data Types are the data types derived from primitive data type. For Example: Array.
User Defined Data Type: The User Defined Data Types are such data type where user/programmer defines the data type according to requirement of the program and it will contain one or more primitive or derived data type.
For Example: If we want to represent a student in a program, the student data may contain various attributes. such as Roll No (int), Name(String/Array[Char]), Address(String/Array[Char]) Etc.
So the Student data will be combination of different Primitive and/or Derived Data Type.
This type of data type is called User Defined Data Type.
Example:
Struct, Class are user defined data type.
"So Classes in Object Oriented Programming is an User Defined Data Type defined by programmer or User according to the program requirement, and Objects are the variable of this data type to use the features of the class."