Add static import for simple IO

Add a static import for simple IO methods.

Java 25 introduces simple IO methods, such as IO.println() and readln() to make interacting with the console more convenient. To use these methods in a compact source file, you don't need to add an import. However, you can add a static import the java.lang.IO class if you prefer. Invoke Context Actions ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) on the method and select the option Add on-demand static import for java.lang.io.

Interested in JVM Development?

call to action image

Did you know you can add simple IO methods with live templates?

Learn More


Related Resources

Convert compact source file to class
Convert compact source file to class
Convert a compact source file to a class in IntelliJ IDEA.
Use Pattern Matching for instanceof
Use Pattern Matching for instanceof
Inspections can guide us to use newer Java features.
Work with records
Work with records
Create a record, or convert between classes and records.