OOP concepts lo doubt   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkArchivesCine Talk - Reviews, Gossips, Insider Info etc.Archive through November 09, 2005OOP concepts lo doubt Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Eeidlagolayenti
Kurra Bewarse
Username: Eeidlagolayenti

Post Number: 880
Registered: 03-2005
Posted From: 66.121.23.130
Posted on Wednesday, November 09, 2005 - 11:44 am:   Edit PostDelete PostView Post/Check IP

ippudu nenu kindha statements use chesthe aa method call avuthundhi
or error vasthundha?

1. emp emp1 = new manager();
emp1.empName();
emp1.duties();

emp emp1 = new manager(); <--- deeni exact meaning enti?
emp object lo manager members assign chesthunatta?

daani meaning new Manager ni instantiate chestunnavu. y




so.. ippudu emp1 lo manager ku asmbandinchina members vuntaru kadha?

you can invoke all the methods of emp on emp1, but to be able to invoke any manager methods, you have to cast it back to manager.

2. manager m1 = new emp();
m1.empName();
m1.duties();

you cannot do this. as every employer cannot be a manager, but every manager is an employer. This is total wrong. you need to use some imagination, for you to understand, not just reading books. :-)
Top of pagePrevious messageNext messageBottom of page Link to this message

Godfather
Bewarse ke Bewarse!
Username: Godfather

Post Number: 29400
Registered: 03-2004
Posted From: 217.157.60.18
Posted on Wednesday, November 09, 2005 - 10:59 am:   Edit PostDelete PostView Post/Check IP

compilre pachi buttulu tidutundi.. dagirlo vunte nuvvu rendu peekina peeka vachu..
He who seeks revenge should remember to dig two graves
Top of pagePrevious messageNext messageBottom of page Link to this message

Nks
Pilla Bewarse
Username: Nks

Post Number: 52
Registered: 08-2004
Posted From: 207.15.10.241
Posted on Wednesday, November 09, 2005 - 10:51 am:   Edit PostDelete PostView Post/Check IP

annalu,
OOP concepts lo oka doubt.

class emp
{
//some method
empName();
}
class manager extends emp
{
//some method
duties();
}

ippudu nenu kindha statements use chesthe aa method call avuthundhi
or error vasthundha?

1. emp emp1 = new manager();
emp1.empName();
emp1.duties();

emp emp1 = new manager(); <--- deeni exact meaning enti?
emp object lo manager members assign chesthunatta?

so.. ippudu emp1 lo manager ku asmbandinchina members vuntaru kadha?


2. manager m1 = new emp();
m1.empName();
m1.duties();

evaranna pai statements gurinchi explain chesthara thanks. errors vasthe
casting cheyali kadha? but endhuku error vasthundho chebuthara?

thanks annalu