Computer >> कंप्यूटर >  >> प्रोग्रामिंग >> Java

जावा 9 में जेएसएचएल दस्तावेज कैसे प्राप्त करें?

Java 9 ने JShell . नामक एक नया इंटरैक्टिव टूल पेश किया . इस टूल का उपयोग एक्सप्रेशन, क्लासेस, इंटरफेस, एनम आदि को निष्पादित करने के लिए किया जा सकता है।

विस्तृत दस्तावेज JShell में पूरी जानकारी के साथ-साथ विभिन्न विकल्पों के साथ इसके आंतरिक कमांड के उपयोग के साथ उपलब्ध हो सकते हैं। इस दस्तावेज़ को दो आदेशों का उपयोग करके एक्सेस किया जा सकता है:"/help " और "/? ". JShell का दस्तावेज़ीकरण केवल इसके आंतरिक नियंत्रणों के संबंध में जानकारी तक ही सीमित नहीं है, और इसमें Javadoc भी शामिल है। ।

नीचे दिए गए कोड स्निपेट में, "/help . का उपयोग करके परिणाम प्राप्त किया जा सकता है "आदेश।

jshell> /help
|   Type a Java language expression, statement, or declaration.
|   Or type one of the following commands:
|   /list [<name or id>|-all|-start]
|     list the source you have typed
|   /edit <name or id>
|     edit a source entry referenced by name or id
|   /drop <name or id>
|     delete a source entry referenced by name or id
|   /save [-all|-history|-start] <file>
|     Save snippet source to a file.
|   /open <file>
|     open a file as source input
|   /vars [<name or id>|-all|-start]
|     list the declared variables and their values
|   /methods [<name or id>|-all|-start]
|     list the declared methods and their signatures
|   /types [<names or id>|-all|-start]
|     list the declared types
|   /imports
|     list the imported items
|   /exit
|     exit jshell
|   /env [-class-path <path> ] [-module-path <path>] [-add-modules <modules>] ...
|     view or change the evaluation context
|   /reset [-class-path <path>] [-module-path <path>] [-add-modules <modules>]...
|     reset jshell
|   /reload [-restore] [-quiet] [-class-path <path>] [-module-path <path>]...
|     reset and replay relevant history -- current or previous (-restore)
|   /history
|     history of what you have typed
|   /help [<command>|<subject>]
|     get information about jshell
|   /set editor|start|feedback|mode|prompt|truncation|format ...
|     set jshell configuration information
|   /? [<command>|<subject> ]
|     get information about jshell
|   /!
|     re-run last snippet
|   /
|     re-run snippet by id
|   /-
|     re-run n-th previous snippet
|   For more information type '/help' followed by the name of a command or a subject.
|   For example '/help /list' or '/help intro'.
|
|   Subjects:
|
|   intro
|     an introduction to the jshell tool
|   shortcuts
|     a description of keystrokes for snippet and command completion,
|     information access, and automatic code generation
|   context
|     the evaluation context options for /env /reload and /reset


जम्मू शेल विभिन्न मौजूदा आंतरिक आदेशों को उनके द्वारा किए जाने वाले कार्यों की त्वरित प्रस्तुति के साथ प्रिंट करता है, और इसके उपयोग के अधिक विस्तृत विवरण तक पहुंचता है। उसके लिए, हमें बस कमांड दर्ज करनी होगी:"/help " कमांड के नाम के बाद विस्तार से (उदाहरण के लिए, "/set "कमांड)।

jshell> /help /set
|
|  /set
|
|   Set jshell configuration information, including:
|   the external editor to use, the start-up definitions to use, a new feedback mode,
|   the command prompt, the feedback mode to use, or the format of output.
|
|   /set editor [-wait] ...
|     Specify the command to launch for the /edit command.
|     The <command> is an operating system dependent string.
|
|   /set start <file>
|     The contents of the specified become the default start-up snippet s and commands.
|
|   /set feedback <mode>
|     Set the feedback mode describing displayed feedback for entered snippets and commands.
|
|   /set mode <mode>[<old-mode>] -command|-quiet|-delete
|     Create or update a user-defined feedback mode, optionally copying from an existing mode.
|
|   /set prompt <mode>"<prompt>" "<continuation-prompt>"
|     Set the displayed prompts for a given feedback mode.
|
|   /set truncation <mode> <length> <selector> ...
|     Set the maximum length of a displayed value.
|
|   /set format <mode> <field> "<format>" ...
|     Configure a feedback mode by setting the format of a field when the selector matches.
|
|   /set
|     Show editor, start, and feedback settings as /set commands.
|     To show the settings of any of the above, omit the set value.
|
|     To get more information about one of these forms, use /help with the form specified.
|  For example: /help /set format


हमें इस तीसरे भाग के दौरान दर्ज किए गए आदेशों को खोजने की जरूरत है, क्या JShell की वापसी को संशोधित करना है (/प्रतिक्रिया सेट करें ), डिफ़ॉल्ट संपादक को संशोधित करने के लिए (/सेट संपादक ), या JShell के प्रारंभ को संशोधित करने के लिए (/सेट प्रारंभ )।

jshell> /help /set feedback
| Set the feedback mode describing displayed feedback for entered snippets and
commands:
|
| /set feedback [-retain] <mode>
|
| Retain the current feedback mode for future sessions:
|
| /set feedback -retain
|
| Show the feedback mode and list available modes:
|
| /set feedback
|
| Where <mode> is the name of a previously defined feedback mode.
| You may use just enough letters to make it unique.
| User-defined modes can be added, see '/help /set mode'
|
| When the -retain option is used, the setting will be used in this and future
| runs of the jshell tool.
|
| The form without <mode> or -retain displays the current feedback mode and available modes.

  1. जावा में वर्तमान तिथि कैसे प्राप्त करें?

    आप जावा में विभिन्न तरीकों से वर्तमान तिथि प्राप्त कर सकते हैं। उनमें से कुछ निम्नलिखित हैं - तिथि वर्ग का निर्माता java.util.Date . का नो-आर्ग कंस्ट्रक्टर class वर्तमान दिनांक और समय का प्रतिनिधित्व करने वाली दिनांक वस्तु लौटाता है, इसका उपयोग करके आप वर्तमान तिथि को नीचे दिखाए अनुसार प्रिंट कर स

  1. जावा 9 में JShell में सिस्टम गुण कैसे प्राप्त करें?

    जेशेल एक REPL (रीड-इवैल्युएट-प्रिंट-लूप) . है सरल कथनों को निष्पादित करने के लिए उपयोग किया जाने वाला उपकरण, इसका मूल्यांकन करता है, और बिना मुख्य () विधि के परिणाम प्रदर्शित करता है। हम इसे केवल jshell . टाइप करके शुरू कर सकते हैं कमांड-लाइन प्रॉम्प्ट में। हमें System.getProperty() . का उपयोग कर

  1. जावा 9 में JavaFX का उपयोग करके JShell को कैसे कार्यान्वित करें?

    जेशेल नमूना अभिव्यक्तियों को लागू करने के लिए उपयोग किया जाने वाला एक इंटरैक्टिव टूल है। हम JavaFX . का उपयोग करके JShell को प्रोग्रामेटिक रूप से कार्यान्वित कर सकते हैं एप्लिकेशन तो हमें नीचे सूचीबद्ध जावा प्रोग्राम में कुछ पैकेज आयात करने की आवश्यकता है jdk.jshell.JShell आयात करें; jdk.jshell.Sn