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 autoboxing in java?

1060


Write java program to reverse string without using api?

1044


Which sorting is used in arrays sort in java?

1077


What is a instance variable in java?

1040


What is meant by inheritance and what are its advantages?

1096


what do you understand by synchronization? : Java thread

983


What are the advantages of assembly language?

928


What is the collection interface?

1017


What is the purpose of using break in each case of switch statement?

1025


How are the elements of a gridbaglayout organized?

1056


What is use of map in java?

1005


How would overload a function based on return type?

957


why not override thread to make a runnable? : Java thread

994


why an outer class cannot be declared as private?

4308


What are loops in java?

1255