Documentation

The Java™ Tutorials
Hide TOC
Questions and Exercises问题和练习
Trail: Learning the Java Language
Lesson: Language Basics

Questions and Exercises: Expressions, Statements, and Blocks问题和练习:表达式、语句和块

Questions问题

  1. Operators may be used in building ___, which compute values.运算符可用于构建表达式中,它用来计算值。
  2. Expressions are the core components of ____.表达式是语句的核心组件。
  3. Statements may be grouped into ___.语句可以分组成
  4. The following code snippet is an example of a ___ expression.下面的代码段是一个合成表达式的示例。
    1 * 2 * 3
  5. Statements are roughly equivalent to sentences in natural languages, but instead of ending with a period, a statement ends with a ___.语句大致相当于自然语言中的句子,但语句不是以句号结尾,而是以分号结尾。
  6. A block is a group of zero or more statements between balanced ___ and can be used anywhere a single statement is allowed.块是对称花括号之间的一组零或多个语句,可以在允许单个语句的任何位置使用。

Exercises练习

Identify the following kinds of expression statements:确定以下类型的表达式语句:

Check your answers


Previous page: Expressions, Statements, and Blocks
Next page: Control Flow Statements