import package in java code example
Example 1: how to import whole package in java
import package.*
Example 2: java import
import java.util.*
import java.util.scanner
public class CheeseBurgerOrderer {
public static void main(String[] args) {
}
}
Example 3: import java.util.*;
import java.util.*;
class cool
{
Scaner sc = new Scanner(System.in);
System.out.println("Enter a decimal");
double a = sc.nextDouble();
Systrem.out.println("The numver u enterd is " + a);
}
Example 4: java file package import
import java.io.File;
Example 5: java packages example
import java.util.Scanner;
Example 6: Can we define package statement after import statement in java
We can’t define package statement after import statement in java.
package statement must be the first
statement in source file. We can have comments before the package statement