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 / manoj

// Do you want to say like this?

//import like this:

import Package1.classA
import Package2.classB

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

Is This Answer Correct ?    27 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is substring 1 in java?

1233


Is java a compiler?

1019


What is the use of hashmap in java?

1133


What is thread safe java?

973


How can we make copy of a java object?

1211


If an object is garbage collected, can it become reachable again?

1065


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

1290


Describe the Big-O Notation.

1098


Explain the difference between jdk, jre, and jvm?

1081


Can you sort a string in java?

971


Write a program to find maximum and minimum number in array?

1045


How is string stored in java?

1119


Why are parameters used in functions?

1076


What is the use of runnable interface?

1233


Does java isempty check for null?

1040