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 hash code collision?

1051


When a byte datatype is used?

2217


What is the difference between reader/writer and inputstream/output stream?

1085


Can you instantiate the math class in Java?

1093


Can you extend singleton class?

1107


What is formatted output?

963


What is scope & storage allocation of global and extern variables? Explain with an example

1044


How we can generate random numbers in java?

1134


What java ide should I use?

998


What is linked hashset and its features?

1064


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

1134


explain different ways of using thread? : Java thread

1017


What is a instance variable?

1067


I want to store more than 10 objects in a remote server? Which methodology will follow?

3206


What is diamond operator in java?

963