Class Definition Java Tutorial

You can import all classes in the same package by using the wild character *.
For example, the following code imports all members of the java.io package.

import java.io.*;
public class Demo {
    //...
}
However, to make your code more readable, it is recommended that you import a package member one at a time.

import java.io.File;
import java.io.FileReader;