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 the difference between future and callable interface in java?

1312


Can we extend immutable class?

1037


Why volatile is used in java?

1141


What is the difference between Array and Hash Table?

1077


Why is a constant variable important?

996


How do you use compareto method?

1065


Explain the importance of throws keyword in java?

1042


What are measurable parameters?

1130


Explain JMS in detail.

1065


What is protected access modifier?

1045


Implementations of set interface?

1065


What is off heap memory?

1061


Can we have multiple catch block for a try block?

1063


what do you mean by stream pipelining in java 8? Explain

1076


What are the legal operands of the instanceof operator?

1078