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

What is a boolean field?

906


What is difference between array and arraylist in java?

932


List the interfaces which extends collection interface?

890


What is the disadvantage of java?

897


What is the default value of the local variables?

958


What is a constructor, constructor overloading in java?

959


What is the difference between a choice and a list?

1021


What is var keyword ?

1126


Mention some features of java?

907


How many bytes is a char in java?

970


What is the difference between an argument and a parameter?

949


What is contract between hashcode and equal method?

978


What happens if we don’t override run method ?

948


what is the difference between a threads start() and run() methods? : Java thread

961


What is tostring () method?

950