how to call a method in different package?

Answer Posted / taresh nama

You Must import the package with fully Qualified name of
the class contains method.
Now you can call a method as:classname.method();
You can create a new object to that class and then call the
method as objectname.method();

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State two differences between C and Java.

683


What is ‘has a’’ relationship in java?

714


Why array is used in java?

505


What are the differences between forwarding () method and sendredirect() methods?

615


Which of the following is not an isolation level in the JDBC

1604






Define an enumeration?

605


Is null a string?

541


What do you understand by soft reference?

576


What is nullpointerexception?

549


What is an iterator interface in java programming?

520


How would you dynamically allocate memory to an array?

580


What is literal example?

556


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

694


What is module in oop?

557


Write a method to check if input string is palindrome?

573