| Author |
Casting
|
Mark Henryson
Ranch Hand
Joined: Jul 11, 2005
Posts: 200
|
|
What is the difference between calling the method thru two different styles I have mentioned in the Code. One with BOLD and another with ITALIC. Both are giving the same result and why we are casting. What are the advantages of casting it?
|
 |
satishkumar janakiraman
Ranch Hand
Joined: May 03, 2004
Posts: 334
|
|
Hi, This line creates an instance of Parent but not an Object of Kid() hence casting is required in this line Now k1 is an object of Kid and calls the method method3(); in the line k is the object of Kid() and directly calls the method3() i hope, it will clear ur doubts. If i am wrong, please post ur correct answer in this forum Bye for now sat
|
 |
satishkumar janakiraman
Ranch Hand
Joined: May 03, 2004
Posts: 334
|
|
Hi small change in my previous posting This line creates a Reference of Parent but not an Object of Kid() hence casting is required in this line bye for now sat
|
 |
satishkumar janakiraman
Ranch Hand
Joined: May 03, 2004
Posts: 334
|
|
Hi small change in my previous posting This line creates a Reference to the Parent but not an Object of Parent. hence casting is required in this line bye for now sat
|
 |
 |
|
|
subject: Casting
|
|
|