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
When can an object reference be cast to an interface reference in java programming?
Explain different forms of polymorphism?
explain autoboxing in java?
What is a constructor overloading in java?
What is the difference between stream and buffer?
Can an interface extend a class?
What is the purpose of final keyword and when to use it?
What is synchronization and why is it important in java programming?
What is a modifier?
What are the 3 types of control structures?
What happens if we don’t define serial version uid?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
Explain treeset?
How to set the permissions to a file in java?
Can you override a final method?