以下是repl的一些特点:
它是java 9内置的。我们可以测试任何java表达式,无需创建类文件、编译和运行。它可以自动补全方法,只需键入tab键,就像在您的编辑器中一样。我们可以定义方法,并在以后调用它们。如果抛出异常,它会显示给我们。我们可以编辑任何方法,并对它们进行更改。有内置命令。以下是使用jshell工具的repl的几个示例。
示例-1c:\users\user>jshell| welcome to jshell -- version 9.0.4| for an introduction type: /help introjshell> math.round(34.543)$1 ==> 35
example-2 的中文翻译为:
示例-2jshell> void test(string s) {...> system.out.println(s);...> }| created method test(string)jshell> test("tutorialspoint")tutorialspoint
以上就是在java 9中,repl的重要性是什么?的详细内容。
