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 generic type?
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com
What are the two types of java programming?
Is there a way to increase the size of an array after its declaration?
Explain when classnotfoundexception will be raised ?
What is difference between path and classpath in java?
What is difference between array and arraylist in java?
What are some alternatives to inheritance?
Difference between Preemptive scheduling vs. Time slicing?
What is a pointer and does java support pointers?
Difference between method overloading and method overriding in java ?
What methods are used in Servlet?Applet communication?
What is variable explain?
What is get () in java?
What are the major drawbacks of external iteration?