In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-10-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
one。 Data types in Java
The variable is to request memory to store the value. That is, when you create a variable, you need to apply for space in memory.
The memory management system allocates storage space for variables according to the type of variables, and the allocated space can only be used to store that type of data. Therefore, by defining different types of variables, you can store integers, decimals, or characters in memory.
Two big data types of Java:
1. Built-in data types (basic data types)
1. Six numeric types (byte, short, int, long, float, double) + void
8 16 32 64 32 64 bit
two。 A character type char
16-bit Unicode character
3. A Boolean boolean
1 bit
two。 About Integer
For two non-new generated Integer objects, the comparison result is true if the values of the two variables are between 128and 127. if the values of the two variables are not in this interval, the comparison result is false.
Integer I = 100 false Integer j = 100 false system. Out.print (I = = j); / / System.out.print
When java compiles Integer I = 100;, it translates to Integer I = Integer.valueOf. The definition of valueOf of Integer type in java API is as follows. The number between-128and 127will be cached. When Integer I = 127, 127will be cached. The next time Integer j = 127 is written, it will be taken directly from the cache and will not be new.
Public static Integer valueOf (int I) {assert IntegerCache.high > = 127; if (I > = IntegerCache.low & & I
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.