Object-Oriented Programming (CS F213) : BITS Pilani
Object-Oriented Programming (CS F213) : BITS Pilani
Object-Oriented Programming (CS F213) : BITS Pilani
• What is an Object ?
• Graphical View of an Object
• Object Examples
• What is a Class ?
• Object vs Class ?
• Class Examples
State/Data
Part
Operations/Logic/Algorithmic Part
A Software
Object
• Box Object :
o State/Data Part : length, width, height, Color [Attributes/Instance Fields]
o Behavior Part: computing area, computing volume [Operations, Methods]
• Dog Object :
o State/Data Part : name, breed, color [Attributes / Instance Fields]
o Behavior Part : barking, fetching, wagging [Operations, Methods]
• Account Object :
o State/Data Part : account number, account holder name, balance, type
of account [Attributes/ Instance Fields]
o withdrawing an amount, depositing an amount, checking balance of a
account [ Behavior, Operations, Methods]
:Box
}// End of class
:Box
Box b2 = new Box(); b2 length width height