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
my interviewer asked me what technical specification you used how to answer that question
Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword
What do you understand by synchronization? Why is it important?
Hi Friends , am newbie to ajax. For example just consider one account registration - A form contains 8 text fields with submit button. In this form second texbox contains "username " . On right side of text box there is a label box . On clilck action i need to determine user is available or not. Is it possible on clicking label or should i click submit button.
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
What are the types of java collections? : java collections
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 queues in the java collection framework? : java collections
What are the classes in the java collection framework? : java collections
What are the types of interface used in the java collections? : java collections
How do I find jre path in windows?
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What is the enumerator of the java collection framework? : java collections
What are the interfaces in java collections? : java collections
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