Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Is there any way to skip finally block of exception even if some exception occurs in the exception block?

1015


What does substring mean?

938


Which variables are stored in heap?

986


What is a static class in java?

973


Name few java.lang classes introduced with java 8 ?

946


Why are parameters used in functions?

958


Can we overload final method in java?

949


Is a string literal?

1025


What is the base class of all classes?

1010


What is a java developer salary?

933


I want to print “hello” even before main is executed. How will you acheive that?

1049


Explain the use of sublass in a java program?

988


Why Java doesn’t support multiple inheritance?

1002


What is the size of string?

1032


What is a java predicate?

929