首頁  >  文章  >  Java  >  在Java 9中,JShell中的Tab鍵有什麼用途?

在Java 9中,JShell中的Tab鍵有什麼用途?

PHPz
PHPz轉載
2023-09-05 19:45:02474瀏覽

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

JShell 還可以在我們部分鍵入現有類別的名稱時提供自動完成功能、變數方法(按Tab 鍵)。如果某個項目無法根據我們輸入的內容確定,則會提供可能的選項。

在JShell 中按Tab 鍵 執行以下任務之一:

  • 如果沒有其他名稱與我們輸入的內容匹配, JShell 會為我們輸入名稱的其餘部分。
  • 如果有是以相同字母開頭的多個名稱,然後 JShell 會顯示這些名稱的清單以幫助接下來輸入什麼內容,然後輸入下一個字母並按 tab# 再次按鍵完成名稱。
  • 如果沒有名稱與我們目前輸入的內容匹配,則會播放警報聲音作為回饋。

範例

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

以上是在Java 9中,JShell中的Tab鍵有什麼用途?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除