摘要:public class sparseArray { public static void main(String[] args) { int[][] array = new int[11][11]; array[1][3] = 1; array[2][4] = 2; for (int[] i:ar
阅读全文
摘要:1、add方法:添加 public class CollectionTest { public static void main(String[] args) { Collection<Object> obj = new ArrayList<>(); obj.add(123); obj.add("h
阅读全文
摘要:public class Test1 { public static void main(String[] args) { int show = show();//直接调用 System.out.println("类方法:"+show); int add = Student.add(11, 12);
阅读全文
摘要:public class Test7 { public static void main(String[] args) { //打印九九乘法表 int s = 0; for (int i=1;i<10;i++){ for (int u=1;u<=i;u++){ s = i*u; System.out
阅读全文
摘要:public class Test6 { public static void main(String[] args) { char grade = 'C'; switch (grade) { case 'A': System.out.println("优秀"); break; case 'B':
阅读全文
摘要:public class Test5 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("请输入需要相加的数(输入x结束):"); int s
阅读全文
摘要:/** * @author HSpringX * @version 1.0 * @since 1.8 */ public class Doc { String name; /** * @author HSpringX * @param 名字 * @return */ public String te
阅读全文
摘要:public class Test3 { public static void main(String[] args) { int a = 3; int b = a++;//a++。先把a赋值给b,a再自增 System.out.println("a++之后的a为:"+a); int c = ++a
阅读全文
摘要:public class Test1 { int a = 10; public static void main(String[] args) { int i = 3; // System.out.println(a); // 主方法为静态方法,不能直接调用成员方法 Test1 d = new Te
阅读全文
摘要:CTRL+X 剪切 CTRL+S 保存 CTRL+A 全选 CTRL+Z 撤销 ALT+F4 关闭窗口 CTRL+SHIFT+ESC 打开任务管理器 Windows键+shift+S 系统的截图(自动保存到剪切板) IDEA快捷键 Ctrl + D 复制光标所在行 或 复制选择内容,并把复制内容插入
阅读全文