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 / saurabh
In main():
::::::::::
Base ob = new Base();
ob.m1();
::::::::::
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is an algorithm in java collection framework? : java collections
Which sorting algorithm is used by collections.sort() in java ?
what is mean by hasing and maping in java platform and advantage?
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
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
What is java collection? : java collections
What is the Spring2.5 MVC Navigation flow?
What is the difference between comparable and comparator in java.util pkg?
How is hashset maintained in memory by java ?
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 uses of the set interfaces in the java collections? : java collections
who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.
What are the different types of features of the java collections framework? : java collections
What are the interfaces in java collections? : java collections
What are the types of java collections? : java collections