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?

Answer Posted / sk

B b=new A();

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

Is This Answer Correct ?    21 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference of Console, web & windows applications?

1587


in teradata level primary in table level allows duplicates why?

1641


You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)

591


What is test execution and when will we start execution please send me one example for this question

1421


How does the type system works when there is interoperability between a COM and .Net, i mean what exactly happens there

1562






what is d main diff between the java and .net framework

1544


what is woransient key word? how it is used in java

1801


What is BASIS

1661


how to check single or double byte in struts

1551


hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com

1524


EXPLAIN UNARY OPEARATORS

1799


what is diff bet ref variable & instance of class

1546


what is the certificates in biztalk?

1428


what is apt_dump_score in datastage where it is useful

1492


What's the difference b/w Table & Templete in Smartform?

1638