devxlogo

Using Static Imports

This feature is new in the JDK 1.5 and is intended to reduce the Java app verbosity. Static imports allow you to put into scope a set of methods and fields. Using static imports, allows you to omit qualifying class names. Here’s an example:

import static java.lang.System.out;import static java.lang.Math.*;public class StaticImport{	public static void main(String[]arr)	{		out.println("This Static Import");		out.println(ceil(10.5));}}

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Seasoned Architects Evaluate New Tech

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.