Object is a real world entity.
Struct in C ?
Data Type ?
Defines the type of data.
Employee
, Student
etc.int
, char
, float
, String
etc.Basic example:
struct Employee {
char name[200];
int age;
float salary;
}
struct Employee employee
class Employee {
string name;
int age;
float salary;
};
“Names given to object are instances.”
Types of memory:
Abstraction allows to layer the semantics of a complex system into more manageable pieces.
It is achieved using the abstract
keyword in Java or virtual
functions / pure-virtual
-functions in C++.