package com.itheima._05类型转换;
/**
- @Description Demo051
- @Author songyu
@Date 2025-05-16 16:21
*/
public class Demo051 {public static void main(String[] args) {
//目标:自动类型转换,范围小自动转换范围大 //字节 自动转 整型 byte b1 = 10; print(b1);//10 //短整型 自动转 整型 short s1 = 129; print(s1);//129 //字符 自动转 整型 char c1 = 'a'; print(c1);//97 //整型 自动转 long int i1 = 100; long l1 = i1; l1=1234567890123456789L; System.out.println(l1); float f1 = l1; System.out.println(f1);//精确8位,其他科学技术法 double d1 = f1;
}
/**
* 打印整型数据
* @param a
*/
public static void print(int a){
System.out.println(a);
}
}