How to call the m1() method of Base class in below snippet ?
class Base
{
public void m1()
{
System.out.println("Base m1 ");
}
public void m2()
{
System.out.println("Base m1 ");
}
}
======================
class Derived extends Base
{
public void m1()
{
System.out.println("Derived m1");
}
public void m3()
{
System.out.println("Derived m3");
}
public static void main(String[] args)
{
Base ob=new Derived();
ob.m1();
//System.out.println("Hello
World!"+ob.m1());
}
}
Answer Posted / harshad
u can call super.m1();
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?
What are the different types of collections views being provided by the map interface? : java collections
Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com
can u draw class/object diagram for ATM
What is deque in the java collections framework? : java collections
my interviewer asked me what technical specification you used how to answer that question
What are the main classes of the list interfaces? : java collections
What are the classes in the java collection framework? : java collections
please mail me the interview question based on java/j2ee
What are the types of interface used in the java collections? : java collections
What are maps interfaces in the java collections? : java collections
What are the interfaces in java collections? : java collections
what is mean by hasing and maping in java platform and advantage?
What is iterator in the java collections framework? : java collections
Should we create system software ( e.g operating system ) in java ?