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

explain local datetime api in java8?

790


Are arrays primitive data types?

865


What is 32 bit float?

779


Can we sort hashset in java?

875


What is the main purpose of serialization in java?

798


Is java se open source?

785


What is java instanceof operator?

812


Is singleton class thread safe?

763


What is the exception hierarchy in java?

745


What is an argument in java?

719


What is nextline method in java?

810


How do you compare two objects?

729


Why is java so important?

893


Java is Pass by Value or Pass by Reference?

820


Why are lists ordered in java?

795