Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

import  RSS feed

 
Arun Prasath
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can import followed by static keyword be given..?
what is a static import?
 
gunasekhar arvind
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static imports is a new feature that was added in Java5.This feature basically enables you to import static fields and methods.

Ex:

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
Java Cowboy
Sheriff
Posts: 16007
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More info: Static Import
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!