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...

What is the use of static import ?

Answer Posted / praveen kumar

The normal import declaration imports classes from packages, so that they can be used without package reference. Similarly the static import declaration imports static members from classes and allowing them to be used without class reference.

Now, we have got an excellent java feature from java 1.5. Ok now we shall see how we can abuse this!

Can i static import everything?
like, import static java.lang.Math.*; – yes it is allowed! Similarly you do for class import.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need data structure in java?

1016


What is entry set in java?

1026


Why volatile is used in java?

983


Can an unreferenced object be referenced again?

1134


What is Classloader in Java?

1128


Can you call a method in a method?

1009


Which is dependent variable?

836


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

1109


What is the synonym of string?

1031


What is private protected in java?

990


What is the base class in java from which all classes are derived?

919


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

1031


why java does not support unsigned keyword?

5115


Can java inner class be static?

972


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1538