You are on page 1of 3

Object cannot be made without classes.

Functions and features:

CLASS CAR

{
Start()

Accelerate()

Stoping()

Outside the class , features remains same while functions changes

The things we call features will be replace with variables and now we will call them data
members

For instance computer have color price power will be its data members.

Methods and Data members

Functions features

Public Private

Private Data member or methods cannot be accessible outside the class.

Public members and methods can be accessible outside the class.

PROTECTED CAN BE ACCESSIBLE WITHIN CLASS AND INHERITED CLASSES ONLY.

PARENT Accessible Private

CHILD Public

Grand Child Public


CLASS DOG

Breed

Colour Private

Eat() Public

Sleep()

CLASS

CLASS Computer

Type Private

Model

Start() Public

Troubleshoot()

Constructor: It is a special function or method .

2.) It is automatically called when object of class is made.

3.) It is used to initialize the object of class. ( object will standardized)

4.) It’s name must be the same of the class.

Destructor: It is also a special function

2.) It’s sign is like car()

3.) It is automatically called when the object of class is destroyed.

4.) It should be included in the class.

You might also like