java 中基本数据类型:四种整数类型(byte、short、int、long)、两种浮点数类型(float、double)、一种字符类型(char)、布尔类型(boolean)
包装类目的: 用于基本数据类型与字符串之间的转化
| 基本数据类型 | 包装类 |
| byte | Byte |
| short | Short |
| int | Integer |
| long | Long |
| float | Float |
| double | Double |
| char | Character |
| boolean | Boolean |
- package com.api.Demo07;
-
- public class Test13 {
- public static void main(String[] args) {
- // int类型范围?最小和最大值
- System.out.println("int最大值:" + Integer.MAX_VALUE);
- System.out.println("int最小值:" + Integer.MIN_VALUE);
- // Integer 属于包装类 包装了 基本数据类型 int
- // int属于基本数据类型 Integer 包装 int 类型
- // 包装类 对原始基本数据类型包装
- // 目的:对基本数据类型与字符串之间转换
- Integer i = 300;
- System.out.println(i);
- }
- }
下一篇文章:Integer包装类