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 are white spaces in java?
How will you add panel to a frame?
Define inheritance with reference to java.
What is javac in java?
What does this mean java?
Define how can we find the actual size of an object on the heap?
Can private class be extended java?
How many types of equations are there?
What is the difference between iterator and list iterator?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
What is package private scope in java?
Can you call a method in a method?
What are the main features of java?
What is a byte string?
Can a class be private or protected in java?