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 scanner is used in java?
Can we have more than one package statement in the source file?
Can we create our own daemon thread?
Can a abstract class be defined without any abstract methods?
How can we pass argument to a function by reference instead of pass by value?
what is deadlock? : Java thread
What is a jagged array in java?
What is difference between overloading and overriding in java?
What is the numeric promotion?
Explain about arraylist?
What are the different types of data structures in java?
What if constructor is protected in java?
What is java Applet?
Write a function to print Fibonacci series and Tribonacci series?
How does sublist works in java?