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 / mitu

class Derived extends Base
{
public void m1()
{
System.out.println("Derived m1");
}
public void m3()
{
System.out.println("Derived m3");
}
public void m26()
{
super.m1();
}

public static void main(String[] args)
{
Derived ob=new Derived();
ob.m1();
ob.m26();
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

2986


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

995


What is the Spring2.5 MVC Navigation flow?

6295


What is the difference between comparable and comparator in java.util pkg?

1063


How is hashset maintained in memory by java ?

1092


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

922


Which sorting algorithm is used by collections.sort() in java ?

874


How do I find jre path in windows?

963


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

978


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

969


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

2041


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

1006


What are the uses of the set interfaces in the java collections? : java collections

926


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.

2000


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

996