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 java is object oriented?

1039


What is the difference between heap memory and stack memory?

1074


Define the term string pool?

1010


Explain what access modifiers can be used for variables?

1061


What is the difference between compare and compareto in java?

1032


How can a gui component handle its own events?

1115


What is local class in java?

1091


Why char array is favored over string for the storage of passwords?

1081


what is meant wrapper classes?

1209


How do you convert an int to a double in java?

1062


Can you override private or static method in java?

980


How do you override a variable in java?

1155


What do bitwise operators do?

1015


What Is Query Throttling in java?

999


How can we find the sum of two linked lists using stack in java?

1157