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
Is java 1.7 the same as java 7?
Are constructors methods?
How do you compare two objects?
What is string :: npos?
Can a class have 2 constructors?
What is autoboxing and unboxing?
What is java in simple terms?
Give us the name of the list layoutmanagers in java?
What is a package in java? List down various advantages of packages.
Why string is a class?
Explain java thread life cycle.
What is high level language in computer?
What is the difference between preemptive scheduling and time slicing?
What is the importance of static variable?
What is the difference between inheritance and encapsulation?