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

What do you mean by order of precedence and associativity?

931


Can we make main() thread as daemon?

1081


Is java pass by value or pass by reference?

965


What is sortedmap interface?

972


How does arraylist size increase in java?

1094


Which is better singleton or static class?

965


How do you include a string in java?

957


Is java se free?

922


What are keywords in programming?

991


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

1238


What is the difference between throw and throws keywords?

1030


What are static initalizers in java ?

995


Why char array is favored over string for the storage of passwords?

1053


can any body body expalin best definitions & best real time exaples for opps concepts.

2247


What is ternary operator in java?

1058