Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


class A{ void me(){s.o.p("");} class B extends A{ void me()
{s.o.p(" ");} class M{ A a=new B(); B b=new A(); a.me();
b.mne();} what is the output of this, how?

Answers were Sorted based on User's Feedback



class A{ void me(){s.o.p("");} class B extends A{ void me() {s.o.p(" ");} class..

Answer / sk

B b=new A();

you cannot assign a superclass object to a reference of
subclass.

Is This Answer Correct ?    21 Yes 4 No

class A{ void me(){s.o.p("");} class B extends A{ void me() {s.o.p(" ");} class..

Answer / kay

class A
{
public virtual void me()
{ s.o.p(" hi");
}
}

class B extends A
{
public override void me()
{ s.o.p(" wat up!");
}
}

class M
{
A a = new B();
a.me();
B b = new A();
b.me();
}

//output :
hi wat up!

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More Programming Languages AllOther Interview Questions

Find out the list of roles which gives access to GUI activities? thanks in advance

0 Answers  


Write a program to implement BFS/ DFS routine in a connected graph

1 Answers  


What is a singleton linked list?

1 Answers   Wipro,


What is the difference b/w Object base and object oriented programming?

1 Answers  


How to print No.of.rows affected after updation using ADO.Net

0 Answers   Tech Mahindra,


how CLR identify vb file?

0 Answers   Tech Mahindra,


why you have to became a software developer?

2 Answers  


What are the Short cut Keys of Tally ERP?

0 Answers  


What is Partial class and its use?

1 Answers  


what is the exact full form of OOPS,O -> object O -> oriented P -> programing S-> ? ....

16 Answers  


through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?

0 Answers   Motorola,


Write a program to find whether a given number is prime or not.

0 Answers   Syntel, Visa,


Categories