Dillon Dillon - 7 months ago 37
Java Question

Java how to import .util into created package

I decided to created a new package and i made class inside that package and tried to Import java.util.Random and it gives me an error "syntax error on token "package", . Expected.

Typing Import java.util.Random Worked in the default package


The package should come before the import

package ballhockeymanagergame;
import java.util.Random;

public class Main { public static void main(String[] args) { } }