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

Plz Show notepad Coding using c# in window based application

1 Answers  


HOW TO DOWNLOAD ORCUT SITE VIDEOS IN PC WITH THE HELP OF MOZILL'S FIREFOX?

0 Answers  


Hi I am Rathnam, How To Remove the duplicates with out using remove duplicate stage in the datastage

0 Answers   TCS,


Write a program to calculate the following i want a Java program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)

4 Answers   HTC,


Compare any 4 software development life cycle paradigms with each other. Indicate at least one application for each of the paradigms that are suitable to developed using that paradigm.

0 Answers  






they asked me about srs (software requirement specifcation)? how can i get anydocumentation about srs & other documnts infomation like bdd, in testing? its urgent?

0 Answers   TCS,


hi..this is kartheek..complted mca in 2009..but i dont have knowledge in programing..but to learn new language.. which one is suitable for me?is SAP or IBM mainframes is suitable for me..?if it suits how much will it costs..?pls answer...

0 Answers  


How many types of list exist in the HTML

2 Answers  


in a company 30% are supervisors and 40% employees are male if 60% of supervisors are male. what is the probability that a randomly choosen employee is a male or female?need steps to solve this?

1 Answers   TCS,


can u help me? how do solve the transpose problem in ireport? if any one know send to eswaran_2006@yahoo.co.in

0 Answers  


Write a Pseudo Code to fins the LCM of two given numbers

5 Answers   Goldman Sachs,


any drawback are there in mantis?

0 Answers  


Categories