Skip to content
Related Articles

Related Articles

Package Imports in JShell of Java 9
  • Last Updated : 15 Apr, 2018

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

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :