What is a java expression
In the Java language, an expression is composed of a variable or a constant A combination of and symbols, for example: num1 num2; or age>18;, etc.
The symbols commonly used in expressions are called operators, and the variables or constants that these operators act on are called operands.
For example: In the expression age>18, age and 18 are operands, and the symbol > is the operator.
In some complex operations, simple expressions can be combined into complex expressions, and the operand itself may be an expression. For example, (num1 num2) * (x y), where the operands (num1 num2) and (x y) are themselves expressions and are multiplied by the operator *.
The evaluation result of the expression must be a value. If the expression is a condition, it will produce a logical value result, that is, true or false. In other cases, the value is usually the result of a calculation.
Legitimate expressions in Java language
① a*b 2
Among them, a, b, 2 are operands, a and b is a variable, 2 is a numerical constant, and is the operator
② 'a' 3
Among them, 'a' is a character constant, and its value when participating in the calculation is the encoding of the character set in which the character is located. Value, is 'a' ASCII? Yes, the expression 'a' 3 is equivalent to 97 3
③ "study" "java"
where, "study" and "java" are characters String constant, is an operator. If the operands on both sides of the operator are string constants, the calculation result is the connection of the two string constants, and the expression result is "study java"
Classification of expressions in Java language
Expressions can be divided into various categories, depending on the type of operator used. The main categories of Java language include: arithmetic expressions, assignment expressions, conditional expressions and logical expressions.
php Chinese website, a large number of free Java introductory tutorials, welcome to learn online!
The above is the detailed content of what is java expression. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools