Package Imports in JShell of Java 9

Package Imports

By default, 10 packages are imported and can also be imported any package by using import statement.

To see, default import packages, we can use following command.
jshell import

Importing java.sql package.
sql import


Listing import packages and it will show available accessible packages.



jshell import

Now number of packages are 11 including new one java.sql.*

Jshell Commands

Jshell provides various useful commands that we can use to modify environment, manage code and to get code related information. Following are the useful information.

Package Imports
import

Command /vars to show variables

/vars

To get all written source code, use /list

/list



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.