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
Define how does a try statement determine which catch clause should be used to handle an exception?
How does a for loop work?
What are the classes of java?
Why is stringbuffer called mutable?
What is anti pattern in programming?
What is a lock or purpose of locks in java?
how to split string in java?
What do you mean by of string::valueof expression in java 8?
What is a java applet? What is an interface?
Is there any limitation of using inheritance?
What is the use of a copy constructor?
Why does java not allow multiple public classes in a java file ?
What is static and final keyword in java?
How do listeners work?
Can a set contain duplicates?