Home  >  Article  >  Java  >  What is the purpose of the Tab key in JShell in Java 9?

What is the purpose of the Tab key in JShell in Java 9?

PHPz
PHPzforward
2023-09-05 19:45:02470browse

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

JShell can also provide autocomplete functionality when we partially type the name of an existing class , Variable or Method (by pressing the Tab key). If an item cannot be determined based on what we entered, possible options are provided.

Press the Tab key in JShell Perform one of the following tasks:

  • If no other name matches what we entered, JShell will enter the rest of the name for us.
  • If there are multiple names starting with the same letter, then JShell will display a list of those names to help with what to type next, then type the next letter and press tab Press the key again to complete the name.
  • If no name matches what we have entered so far, an alert sound will be played as feedback.

Example

<strong>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></strong>

The above is the detailed content of What is the purpose of the Tab key in JShell in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete