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

8.In DSP,Define Signal and System?and various type of signals.

0 Answers  


can any one suggestion me present which course(except java,.net) has huge demand in the market?

0 Answers  


Why did you ever become involved in QA/testing?

0 Answers  


What is a must for multitasking? a) Process preemption b) Paging c) Virtual memory d) None of the above

9 Answers   InterGraph,


My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?

0 Answers   State Bank Of India SBI,


What is the difference between in-proc and out-of-proc?

2 Answers   Oracle,


Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

0 Answers   Amazon,


how can we get version of database ?

1 Answers  


What is the use of sas software? Is sas and sap are different?

0 Answers  


What is the difference between compiled and interpreted languages?

1 Answers  


1.Mutating table

0 Answers  


why main() method should not return any value

2 Answers   Accenture,


Categories