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
What is a function argument in java?
What is io stream in java?
Can we have more than one package statement in source file ?
What is the use of parse function in java?
What is the relationship difference the canvas class and the graphics class?
Can a class extend 2 classes in java?
Explain the features of interfaces in java?
What is not object oriented programming?
List types of storage classes in java?
Can a string be null?
What are the 4 types of research methods?
Is java platform independent?
Is list ordered in java?
What is the difference between form & report?
What are byte codes?