JShell 还可以在我们部分键入现有类的名称时提供自动完成功能、变量或方法(通过按 Tab 键)。如果某个项目无法根据我们输入的内容确定,则会提供可能的选项。
在 JShell 中按 Tab 键 执行以下任务之一:
C:UsersUser>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>