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 basic data types of java

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the basic data types of java". In daily operation, I believe many people have doubts about what basic data types java has. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what basic data types does java have?" Next, please follow the editor to study!

1. Integer, byte, short, int, long

Value range of byte:-128 to 127 (- 2 to-1)

The value range of short:-32768 / 32767 (- 2 to-1 / 15)

The value range of int:-21474836481147483647 (31 power of-2 to 31 power-1 of 2)

Value range of long:-92233720368547748089223372036854774807 (63 power of-2 to 63 power-1 of 2)

2. Floating point type, float, double

Both float and double represent floating-point data types, and the difference between them lies in their accuracy.

Range of values for float (single-precision floating-point type): 3.402823e+38~1.401298e-45 (eHarmony 38 is multiplied by 10 to the 38th power, while eMurray 45 is multiplied by 10 to the minus 45th power).

Value range of double (double precision floating point): 1.797693e+308~4.9000000e-324 (ditto)

3. Character type, char.

Char ch ='a character; / / can be Chinese character, because it is Unicode code char ch = 1010; / / can be decimal number, octal number, hexadecimal number, and so on. Char ch ='\ 0binary; / / can be initialized with character encoding, for example:'\ 0' indicates the Terminator, and its ascll code is 0, which means the same meaning as ch = 0.

4. Boolean type, boolean.

There are only two values: true and false.

At this point, the study on "what are the basic data types of java" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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