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
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
What are the classes in the java collection framework? : java collections
What are the uses of the set interfaces in the java collections? : java collections
What is the enumerator of the java collection framework? : java collections
What are the considerations to be made in case of loops in java ?
What are the differences between the java collection and the java list? : java collections
What are the queues in the java collection framework? : java collections
Should we create system software ( e.g operating system ) in java ?
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 types of java collections? : java collections
what is mean by hasing and maping in java platform and advantage?
What is deque in the java collections framework? : java collections
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
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.?.