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

Package1 and Package2 both have a method name lets say
"methodA" with different implementation. When I import both
the packages in a java class how can I use both the methods?

Answer Posted / shiv

//import like this:

import Package1.class
import Package2.class

//use it in your class
class yourclass
{
class.methodA(); // Package1 method call
class.methodA(); // Package2 method call
}

Is This Answer Correct ?    6 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how to implement singleton design pattern in struts.

1005


Write a program in java to create a doubly linked list containing n nodes.

972


Can we override the private methods?

1010


How do you achieve polymorphism in java?

998


Is space a character in java?

1010


What are the access modifiers in java?

1038


What is listnode in java?

993


What are examples of modifiers?

1128


Is string is a keyword in java?

977


What is a flag value?

1027


Which package is used for pattern matching with regular expressions?

1115


what is method reference in java 8?

1035


design an lru cache in java?

1005


How does class forname work in java?

966


What is meant by data hiding in java?

1158