Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of static import ?

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


Please Help Members By Posting Answers For Below Questions

Is java 1.7 the same as java 7?

987


Are constructors methods?

953


How do you compare two objects?

877


What is string :: npos?

1001


Can a class have 2 constructors?

848


What is autoboxing and unboxing?

947


What is java in simple terms?

948


Give us the name of the list layoutmanagers in java?

876


What is a package in java? List down various advantages of packages.

1195


Why string is a class?

894


Explain java thread life cycle.

966


What is high level language in computer?

967


What is the difference between preemptive scheduling and time slicing?

1003


What is the importance of static variable?

1053


What is the difference between inheritance and encapsulation?

1091