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

Define how does a try statement determine which catch clause should be used to handle an exception?

1158


How does a for loop work?

986


What are the classes of java?

963


Why is stringbuffer called mutable?

993


What is anti pattern in programming?

967


What is a lock or purpose of locks in java?

1022


how to split string in java?

1211


What do you mean by of string::valueof expression in java 8?

966


What is a java applet? What is an interface?

1096


Is there any limitation of using inheritance?

1086


What is the use of a copy constructor?

988


Why does java not allow multiple public classes in a java file ?

4531


What is static and final keyword in java?

1020


How do listeners work?

1044


Can a set contain duplicates?

948