Home  >  Article  >  Java  >  How much do you know about the basic data types that must be understood in Java development?

How much do you know about the basic data types that must be understood in Java development?

little bottle
little bottleOriginal
2019-04-03 10:51:232746browse

Every developer who has just started learning the Java programming language must understand the basic data types needed. Check out this article to test how much you know!

How much do you know about the basic data types that must be understood in Java development?


Java’s four categories and eight basic data types

The first category: whole Type byte, short, int, long

The second type: floating point type float, double

The third type: logical type boolean (it only has two values ​​that can be true/false)

Category 4: Character type char

Java reference data type

Arrays, classes and interfaces

Bytes Bybts (one byte is equal to 8 bits)
boolean Boolean type                     1/8
byte byte type                   1
char character type                                                                                               ’ ’ ’ ’ ’ ’ 1/8      
byte byte type             behind through ’ ’ ’ ’ out out out out out out off out's out's' ’ ’ ’ ’ ’’s through out through through ‐ through ‐‐‐‐‐‐‐‐‐‐ long                          2
int integer type                 4
float Floating point type (single precision)                                                                                                                                                                                                           To define it as a float type, you need to add l or L after the value;
The default floating point type is also a double-precision floating point. If you want to define it as a float type, you need to add f or F after the value.


Automatic conversion of basic data typesHow much do you know about the basic data types that must be understood in Java development?byte->short,char -> int -> long

float -> double

int -> float

long -> double

TIP: Small lengths can be converted to larger ones , however, the original accuracy will be lost when changing from large to small! ! !

The article ends here. I wonder if you remember it? Go watch Java related videos and learn in depth with the teacher!

The above are the details of Java’s basic data types. For more information, please pay attention to other related articles on the PHP Chinese website!

[Recommended courses: Java related courses]

##

The above is the detailed content of How much do you know about the basic data types that must be understood in Java development?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn