"Objects and Classes": Seminar On
"Objects and Classes": Seminar On
Syntax:
Class class_name {
Data Members;
Methods;
}
Class Members
Data and functions are members.
Data Members and methods must be declared within the class
definition.
A member cannot be redeclared within a class.
No member can be added elsewhere other than in the class
definition
Example
Class A
{
int i;
int j;
void f (int, int);
int g();
}
// j is a data member of class A
// j is a data member of class A
} Number: 12
Enter data: 23.3
float insertFloatData() { You entered 23.3
return data2;
} };
Allocate memory for objects.
Int :- 2Bytes
Char :- 1Bytes
Float :- 4Bytes
Double :- 8
Object-oriented programming (OOP) is a computer
programming that uses objects, data structures that consists of
methods and data fields with their interactions to design
computer programs and applications. This technique includes
many features like
data abstraction, encapsulation, polymorphism, and
inheritance.
Thank You