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

What is the formula to calculate percentage?

540


What are multiple inheritances? Is it supported by java?

471


Can you make a constructor final in Java?

630


What is the largest number a double can hold?

568


What are inbuilt functions in java?

565






What is a boolean expression in java?

538


How do you write methodology?

566


What is super keyword explain with example?

539


Difference between character constant and string constant in java ?

560


Is string serializable in java?

549


What are the important methods of java exception class?

576


What is the importance of finally block in exception handling?

545


Is arraylist a class in java?

539


What is an example of a keyword?

550


What is the purpose of return statement?

632