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 is tostring () method?

1090


What is string data type?

1019


Can an object be null?

1012


How do you initialize an arraylist in java?

1097


What do you understand by the bean persistent property?

1066


Can we declare register variable as global?

965


How do you reverse a string in java?

1206


Explain wrapper classes in java?

1059


What do you mean by multithreaded program?

1063


Explain aggregation in java?

1017


What is methods and methodology?

1074


How to run a JAR file through command prompt?

1341


What are the approaches that you will follow for making a program very efficient?

1128


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.

1090


What type of value does sizeof return?

1073