siyuliu  

2025年10月22日

摘要: 函数定义 public class Main { public static void main(String[] args) {} public void add() {} } 局部变量 在下面定义的变量,随写随用 public static void main(String[] args) {} 阅读全文
posted @ 2025-10-22 21:24 nnnnnnunn 阅读(0) 评论(0) 推荐(0)
 
摘要: 强制转换 1、高到低(int》byte) int i=12; byte b=(byte)i; 2、低到高(int》double) int i=12; double b=i; 3、不能对布尔值转换 4、转换的时候可能存在内存溢出和精度问题 5、 char c='a'; int d=c+1; Syste 阅读全文
posted @ 2025-10-22 19:31 nnnnnnunn 阅读(0) 评论(0) 推荐(0)
 
摘要: int i=0b10;//2进制0b int i2=010;//八进制0 int i3=0x10;//十六进制0x float f=0.1f; double d=0.1; System.out.println(d); System.out.println(i2); System.out.printl 阅读全文
posted @ 2025-10-22 18:26 nnnnnnunn 阅读(0) 评论(0) 推荐(0)