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
Why java is object oriented?
What is the difference between heap memory and stack memory?
Define the term string pool?
Explain what access modifiers can be used for variables?
What is the difference between compare and compareto in java?
How can a gui component handle its own events?
What is local class in java?
Why char array is favored over string for the storage of passwords?
what is meant wrapper classes?
How do you convert an int to a double in java?
Can you override private or static method in java?
How do you override a variable in java?
What do bitwise operators do?
What Is Query Throttling in java?
How can we find the sum of two linked lists using stack in java?