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 common operators in java

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly shows you "what operators are commonly used in java", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what operators are commonly used in java" this article.

Symbols that operate on constants and variables are called operators

Expressions that use operators to concatenate constants or variables to symbolize java syntax can be called expressions.

Expressions joined by different operators represent different types of expressions.

For example: define two variables of type int, amemb, and do addition (a + b)

Common operators:

Arithmetic operator

Assignment operator

Relational operator

Logical operator

Ternary operator

Today we focus on arithmetic operators:

Basic arithmetic operations

It is nothing more than addition, subtraction, multiplication, division and remainder.

For example:

Usage of%

What  gets is the remainder of two divisible data.

The use of : to judge whether two data are divisible

Multiple uses of +

Addition of  numbers (this is the most commonly used mathematical calculation)

 character addition: using characters to store the corresponding data values in the computer to participate in the operation.

You can see that the final output is 108 and 107. If you subtract 10 from the corresponding value, you will get the value of the character type, which are commonly used and need to be kept in mind:

'0'-> 48

'1'-> 49

'a'- > 97

'b'-> 98

'After music-> 65

The last is the addition of strings:

The + here is not really an addition, but a string concatenator; strings and other types of data

Do splicing, the result is a string type

/ / this symbol represents comments, which are generally needed to make your code clearer.

Of course, if you write thousands of lines of code without adding a comment, you look like you'll struggle later.

The above is all the contents of the article "what are the commonly used operators in java?" 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

Internet Technology

Wechat

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

12
Report