您好,欢迎访问一九零五行业门户网

如何在Java 9中设置JShell的详细模式?

jshell 是在java 9中引入的repl 工具。我们可以使用这个工具在命令行提示符中执行简单的代码片段。
当我们在jshell中输入算术表达式、变量等时,它会显示结果,但不会显示创建的变量的类型详细信息。在jshell中可以使用详细模式显示更多关于输入命令执行的信息。我们需要使用命令/set feedback verbose(命令前面可以加/)来获取更多关于执行的命令的信息。
在下面的代码片段中,详细模式已经打开,它可以显示更多关于变量类型的信息。
c:\users\user>jshell| welcome to jshell -- version 9.0.4| for an introduction type: /help introjshell> /set feedback verbose| feedback mode: verbosejshell> 5.0 * 8$1 ==> 40.0| created scratch variable $1 : doublejshell> string str = "tutorialspoint";str ==> "tutorialspoint"| created variable str : stringjshell> void test() {...> system.out.println("tutorix");...> }| created method test()jshell> test()tutorixjshell> string str1 = new string("tutorix");str1 ==> "tutorix"| created variable str1 : stringjshell> "tutorialspoint" + "tutorix" + 2019$6 ==> "tutorialspointtutorix2019"| created scratch variable $6 : stringjshell> int test1() {...> return 10;...> }| created method test1()jshell> test1()$8 ==> 10| created scratch variable $8 : int
以上就是如何在java 9中设置jshell的详细模式?的详细内容。
其它类似信息

推荐信息