Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the Java operators

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the Java operators", which is easy to understand and clear, hoping to help you solve your doubts. Let the editor lead you to study and learn this article "what are the Java operators?"

1 、 Arithmetic operator description example + addition: the value A + B on both sides of the addition operator equals 30-subtraction: the left Operand minus the right Operand A-B equals-10 * multiplication: the value A * B on both sides of the multiplication operator A * B equals 200 / division: the left Operand divided by the right Operand B / An equals 2 times + self-increment: the value of the Operand increases by 1Bit+ or + + B equals 21 color-self Minus: the value of the Operand minus 1B or-- B equals 192, Relational operator description example = = check if the values of two operands are equal If equal, the condition is true. (a = = B) is false. ! = check whether the values of the two operands are equal, and if the values are not equal, the condition is true. (a! = B) is true. > check whether the value of the left Operand is greater than that of the right Operand. If so, the condition is true. (a > B) is false. = check whether the value of the left Operand is greater than or equal to the value of the right Operand, and if so, the condition is true. (a > = B) is false. > > the bitwise right zero padding operator. The value of the left Operand shifts to the right by the number of digits specified in the right Operand, and the resulting vacancy is filled with zero. A > 2 get 15 or 0000 11115, assignment operator description example = simple assignment operator, assign the value of the right Operand to the left Operand C = A + B will assign the value obtained by A + B to the addition and assignment operator, it will add the left Operand and the right Operand to the left Operand C = An is equivalent to C = C + A.

Similar to + =, other arithmetic operators, bit operators, and logical operators can be added before =.

6. Conditional operator variable x = (expression)? Value_if_true: value_if_false;7, instanceof operators

This operator is used to manipulate an object instance to check whether the object is of a specific type (class type or interface type).

Variable instanceof class_or_interface_type_name

For example:

String name = "James"; boolean result = name instanceof String; / / because name is a String type, so return all the contents of the article "what are the Java operators?" thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report