A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Jul 18, 2006
Sep 07, 2006 00:17:00
can import followed by static keyword be given..?
what is a static import?
Joined: Sep 05, 2006
Sep 07, 2006 00:58:00
Static imports is a new feature that was added in Java5.This feature basically enables you to import static fields and methods.
import static java.lang.System.out;
import static java.lang.Integer.*;
/* If you use the above static imports then you can use the following */
out.println("Hi");/* Instead of having to say System.out.println("Hi"); */
out.println(MAX_VALUE); /* instead of System.out.println(Integer.MAX_VALUE); */
Jesper de Jong
Joined: Aug 16, 2005
Sep 07, 2006 01:46:00
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
doubt about import static
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015