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 is tostring () method?
What is string data type?
Can an object be null?
How do you initialize an arraylist in java?
What do you understand by the bean persistent property?
Can we declare register variable as global?
How do you reverse a string in java?
Explain wrapper classes in java?
What do you mean by multithreaded program?
Explain aggregation in java?
What is methods and methodology?
How to run a JAR file through command prompt?
What are the approaches that you will follow for making a program very efficient?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
What type of value does sizeof return?