Home > Java > javaTutorial > body text

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

PHPz
Release: 2023-09-05 19:45:02
forward
499 people have browsed it

在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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template