在Java 9中,JShell中的Tab键有什么用途?

PHPz
PHPz 转载
2023-09-05 19:45:02 137浏览

在Java 9中,JShell中的Tab键有什么用途?

JShell 还可以在我们部分键入现有的名称时提供自动完成功能、变量方法(通过按 Tab 键)。如果某个项目无法根据我们输入的内容确定,则会提供可能的选项。

在 JShell 中按 Tab 键 执行以下任务之一:

  • 如果没有其他名称与我们输入的内容匹配,JShell 会为我们输入名称的其余部分。
  • 如果有是以相同字母开头的多个名称,然后 JShell 会显示这些名称的列表以帮助接下来输入什么内容,然后输入下一个字母并按 tab 再次按键完成名称。
  • 如果没有名称与我们目前输入的内容匹配,则会播放警报声音作为反馈。

示例

C:\Users\User>jshell
| Welcome to JShell -- Version 9.0.4
| For an introduction type: /help intro

jshell> String studentName(String firstName, String lastName)
...> {
...>    return firstName + lastName;
...> }
| created method studentName(String, String)

jshell> /methods
| String studentName(String, String)

jshell> str <Press Tab Key>
studentName(

jshell> studentName(
studentName(

Signatures:
String studentName(String firstName, String lastName)

<press tab again to see documentation>

jshell> studentName(
String studentName(String firstName, String lastName)
<no documentation found>

<press tab again to see all possible completions; total possible completions: 545>

以上就是在Java 9中,JShell中的Tab键有什么用途?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除