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 / suma.k

in main method

Base b1=new Base ();
b1.m1();

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1050


Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword

2048


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

1061


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

1159


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

1040


What are the different types of ways where you can iterate over a list? : java collections

1046


What are the different types of classes implemented in the set interfaces? : java collections

1065


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

1047


What are the interfaces in java collections? : java collections

1154


What are the different types of collections views being provided by the map interface? : java collections

1041


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

1029


What are the differences between the java collection and the java list? : java collections

1121


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

1035


What are the different types of features of the java collections framework? : java collections

1117


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.?.

2334