Answer Posted / qamrun nisa
The static import construct allows unqualified access to
static members without inheriting from the type containing
the static members. Instead, the program imports the
members, either individually:
import static java.lang.Math.PI;
or en masse:
import static java.lang.Math.*;
Once the static members have been imported, they may be used
without qualification:
double r = cos(PI * theta);
The static import declaration is analogous to the normal
import declaration. Where the normal import declaration
imports classes from packages, allowing them to be used
without package qualification, the static import declaration
imports static members from classes, allowing them to be
used without class qualification.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What do you mean by order of precedence and associativity?
Can we make main() thread as daemon?
Is java pass by value or pass by reference?
What is sortedmap interface?
How does arraylist size increase in java?
Which is better singleton or static class?
How do you include a string in java?
Is java se free?
What are keywords in programming?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
What is the difference between throw and throws keywords?
What are static initalizers in java ?
Why char array is favored over string for the storage of passwords?
can any body body expalin best definitions & best real time exaples for opps concepts.
What is ternary operator in java?