OBJECT ORIENTED PROGRMMING
a calss defines the str & behaviour (data ;code) taht'll be shared by set of objects……
a combination of data & behaviour……
there r two types of persons involved wth classes ……
1. class developer
2. calss programmer
class developer develops class n two steps ..
a. interface which'll seen by programmer e,g btns of VCR…
b.implementation which'll be hidden by class programmer e,g circuits of VCR..
a constructor s a member func wth same name as class , that s executed automatically when ever an obj s ceated….
Conditions For Constructors
1. const r sp func having same name as class
2.no return type even void isn't allowed
3.const s automatically called when obj s created..
r of two types
1. data constructs : e,g str & class , ends wth semicolon….
2. control constructors: e,g function & loops , don't end wth semicolon……
s a member func wth same name as it's class but proceded by a telda(~)..
it s called when an obj s destroyed , a destructor takes no argument & has no return type…
Order Of Execution
constructor:: form parent to child
destructor:: from child to parent
function::: from child to parent
functions that r included wth in a class r know as member func