Home  >  Article  >  Java  >  What are the data types in java

What are the data types in java

王林
王林Original
2019-11-16 13:34:074997browse

What are the data types in java

Data type:

What are the data types in java

##Notes:

1: In the Java development process, int is used for integers, double is used for decimals, and boolean is used for booleans;

2: Type conversion is all about conversion from a small range to a large range. Conversion from a large range to a small range requires the use of forced conversion. ;

For example: (1)int a=12;double b=a;(2)double a=3.0;int b=(int)a;

3:long,byte, Char, etc. are rarely used and are generally used in data processing;

4: The conversion between int and char is through ASCII conversion;

For example: char a =' A';int b=a;System.out.prientln(b);The final output result is 65;

5: String type, String is the essential and most used data type in the project, it Belongs to the category of "class" in reference data types.

Encapsulation class of basic data types

What are the data types in java## Recommended tutorial:

Java tutorial

The above is the detailed content of What are the data types in java. 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