Package Imports in JShell of Java 9

JavaServer Side ProgrammingProgramming

In general, 10 packages are imported using the JShell.

The following command shows the packages that were imported by default.

jshell> /import

Output

import java.io.*
import java.math.*
import java.net.*
import java.nio.file*
import java.sql.*
import java.util.*
import java.util.regex*
import java.util.function*
import java.util.prefs*
import java.util.stream.*

Importing a specific package using JShell

jshell> import java.util.*;
raja
Published on 13-Jul-2020 15:32:54
Advertisements