Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is an algorithm in java collection framework? : java collections

1001


What is iterator in the java collections framework? : java collections

919


What is the enumerator of the java collection framework? : java collections

979


What are the considerations to be made in case of loops in java ?

983


Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.

2037


What is the use of the list interface in the java collection? : java collections

976


What are the types of interface used in the java collections? : java collections

992


can u draw class/object diagram for ATM

6004


Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?

2977


What are the main classes of the list interfaces? : java collections

974


What are the queues in the java collection framework? : java collections

966


What are the types of the main implementing classes in the map interfaces? : java collections

1087


Which java collection class can be used to maintain the entries in the order in which they were last accessed?

994


What are the interfaces in java collections? : java collections

1073


my interviewer asked me what technical specification you used how to answer that question

2321