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 are the interfaces in java collections? : java collections
Which interface does java.util.hashtable implement?
What are the considerations to be made in case of loops in 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 is the difference between comparable and comparator in java.util pkg?
What are the different types of features of the java collections framework? : java collections
What are the differences between the java collection and the java list? : java collections
Which sorting algorithm is used by collections.sort() in java ?
can u draw class/object diagram for ATM
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 is iterator in the java collections framework? : java collections
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
Hi frnds how to lock an user when he enter wrong credentials more than 3 time using java or j2ee tech take username and password in a bean no need to connect DB and validate give me some sample application code or links its urgent for me thanks in advance
What are the uses of the set interfaces in the java collections? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.