In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how many data types defined by java, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Java defines eight simple (or basic) data types: byte, short, int, long, char, float, double, boolean. These types can be divided into four groups:
Integer: this group includes byte type (byte), short integer type (short), integer type (int), long integer type (long), which have signed integers.
Floating point numbers: this group includes floating point numbers (float) and double precision numbers (double), which represent numbers with decimal precision requirements.
Characters: this group includes character types (char), which represent the symbols of the character set, such as letters and numbers.
Boolean: this group includes Boolean (Boolean), which is a special type that represents true / false values.
You can use them by definition, or you can construct an array or class type to use them. In this way, they form the basis for all other types of data you may create.
Simple data types represent single values, not complex objects. Java is fully object-oriented, but simple data types are not. They are similar to the simple data types of most other non-object-oriented languages. The reason for this is due to efficiency considerations. The introduction of simple data types in object-oriented will not have much impact on execution efficiency.
The definition of simple types has a clear scope and has mathematical characteristics. In languages like C and C++, the integer size varies according to the execution environment. However, this is not the case with Java. Because of the portability requirements of Java, all data types have a strictly defined scope. For example, no matter what platform it is based on, int is always 32-bit. Programs written in this way are guaranteed to run on any machine architecture. Of course, strictly specifying the size of an integer may cause a performance loss in some environments, but this loss is necessary to achieve portability.
The above is all the content of the article "how many data types is defined by 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.