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 OOP Language?
What is the difference between the font and fontmetrics classes in java programming?
What is a class object?
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.
Which is illegal identifier in java?
What is the memory leak in java?
What is the use of default method in interface in java? Explain
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?
what is difference between equals and ==?
What is the difference between pass by reference and pass by pointer?
Should database connections be singleton?
what is a working thread? : Java thread
Can java arraylist hold different types?
Explain about fail safe iterators in java?