- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is static import in Java?
As import statement allows to use a class without its package qualification, static import allows to access the static members of a class without class qualifications. For Example, to access the static methods you need to call the using class name −
Math.sqrt(169);
But, using static import you can access the static methods directly.
Example
import static java.lang.Math.*; public class Sample{ public static void main(String args[]){ System.out.println(sqrt(169)); } }
Output
13.0
- Related Articles
- Demonstrate Static Import in Java
- What are the differences between import and static import statements in Java?
- Static import the Math Class Methods in Java
- Use static Import for sqrt() and pow() methods in class Math in Java
- What is static binding in Java?
- What is a static class in Java?
- What does import Java.util.* in Java do?
- What is static blank final variable in Java?
- What is the difference between static classes and non-static inner classes in Java?
- What is import attribute in JSP?
- What is the equivalent of Java static methods in Kotlin?
- What are static imports in java? Example.
- What is the equivalent of Java static final fields in Kotlin?
- What is blank final variable? What are Static blank final variables in Java?
- Where and how is import statement used in Java programs?

Advertisements