摘要: 今日学习了数据结构和Java的基本语法。 阅读全文
posted @ 2024-09-23 19:55 仙人兵马俑 阅读(21) 评论(0) 推荐(0)
摘要: 这种输出结果是因为当字符串与其他变量一起使用时,其他变量会被转化为字符串,"X+Y="+X+Y中,后边的X和Y会变成字符串,所以会直接连接起来,不会被计算,而X+Y+"=X+Y"中,X和Y的计算在前面,所以会优先计算为一个整形,再变成字符串与后面连接。 阅读全文
posted @ 2024-09-23 17:55 仙人兵马俑 阅读(291) 评论(0) 推荐(0)
摘要: public class EnumTest { public static void main(String[] args) { Size s=Size.SMALL; Size t=Size.LARGE; System.out.println(st); System.out.println(s.ge 阅读全文
posted @ 2024-09-23 17:47 仙人兵马俑 阅读(267) 评论(0) 推荐(0)
摘要: public class Main { public static void main(String[] args) { int a1=0,a2=0,i=0,x=0; for(i=0;i<30;i++) { a1=(int)(Math.random()100)+1; a2=(int)(Math.ra 阅读全文
posted @ 2024-09-23 17:29 仙人兵马俑 阅读(17) 评论(0) 推荐(0)