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 / sriragv

You can not call a method like above unless untill ur
classes are static.
You can create instance and u can use as

Instance.method();

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the syntax of multiple inheritance? When do we use such an inheritance?

822


Can we create object of inner class in java?

692


Define inheritance with reference to java.

796


How to call one constructor from the other constructor ?

810


Explain method overloading?

752


Give us the name of the list layoutmanagers in java?

707


What is an interface in java?

779


Explain what access modifiers can be used for methods?

789


What is overriding in java?

748


please send me hr interview questions in it industry

1894


What are the problems faced by java programmers who don't use layout managers?

742


Is void a data type?

711


How list contains works in java?

738


What is the association?

761


What is the latest version of java?

798