What are the different feedback modes for JShell in Java 9?
在JShell工具中执行操作时,会在return中显示一条消息(命令成功、错误、操作类型)创建的变量及其值)。它已使用以下命令进行自定义: “/set Feedback”。此命令显示当前配置的返回类型以及可用的不同返回模式。
1 2 3 4 5 6 7 8 |
|
JShell 中有四种反馈模式,如下所示:
1) /set反馈正常:这是默认JShell 反馈。当我们计算表达式时,JShell 返回相应的结果以及存储该值的内部变量。在变量创建的情况下,JShell 返回变量的名称和相应的值。创建数据类型(方法或类)时,JShell 会发送一个返回值,指定我们创建的类型。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
2) /set feedback verbose: 这是最具有信息性的反馈模式。在评估指令时,它会显示相应的结果,以及被赋值的内部变量和表达式的类型。对于变量的创建也是如此。至于数据类型的创建,返回结果与正常模式相同。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
3) /set feedback concise: 这种模式显示最小的信息量。在评估表达式时,它告诉我们创建的内部变量的名称以及表达式的结果。另一方面,关于数据类型(变量、方法或类)的创建,JShell 不会返回任何结果(除非代码有错误)。
1 2 3 4 5 6 7 8 9 |
|
4) /set feedback silent: 这种模式不显示任何信息。当我们输入一个表达式进行求值时,JShell会将结果存储在一个内部变量中,但不会在屏幕上显示相应的结果。对于数据类型(变量、方法或类)的创建也是如此。所有的操作都在内部完成,不会在屏幕上显示任何结果(除非出现错误)
1 2 3 4 5 6 7 8 9 10 11 12 |
|
The above is the detailed content of What are the different feedback modes for JShell in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.
