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
Difference between java and javascript
How many types of variables are there?
Can a static block throw exception?
Can a class declared as private be accessed outside it’s package?
What is a functional interface?
Compare Mutex and Semaphore in java.
What is an 8 bit word?
What does sprintf mean?
What is the purpose of default constructor?
What is a substring of a string?
What is integer parseint?
What is final keyword in java?
Why runnable interface is used in java?
Is array dynamic in java?
Are strings immutable in java?