摘要: 格式 x ? y : z 解释 如果x==true,则结果为y,反之为z; 代码演示 //三元运算符 public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print 阅读全文
posted @ 2020-07-15 15:52 大酷仔 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 概述 方法是语句的集合,组合在一起就可以实现一个功能。 方法是解决一类问题的步骤的有序集合 方法包含于类或对象中 方法在程序中被创建,在其他地方被引用 阅读全文
posted @ 2020-07-15 13:14 大酷仔 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 自增运算符 代码演示 public static void main(String[] args) { int a = 1; int b = a++; System.out.println("a="+a); // 2 int c = ++a; System.out.println("b="+b); 阅读全文
posted @ 2020-07-10 13:26 大酷仔 阅读(172) 评论(0) 推荐(0) 编辑