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 java algorithm?

927


What is the symbol for line break?

1091


Is null keyword in java?

934


What is the name of the java compiler?

1049


how do I create a runnable with inheritance? : Java thread

976


What is jit compiler in java?

1096


Can you use abstract and final both with a method?

1061


How do you detect memory leaks?

1057


How we create object in copy constructor?

1111


What is meant by data hiding/encapsulation?

1101


What are the elements of java?

1008


How many types of string data types are there?

1085


When we should use serialization?

1015


Why we override equals() method?

1030


List some java keywords sun like c, c + + keywords?

998