摘要:多态 父类 package com.oop.demo06; public class Person { public void run(){ System.out.println("run"); } } 子类 package com.oop.demo06; public class Student
阅读全文
摘要:重写 父类 package com.oop.demo05; //重写都是方法的重写,和属性无关 public class B { public void test(){ System.out.println("B=>test()"); } } 子类 package com.oop.demo05; /
阅读全文
摘要:类与对象的关系 package com.oop.demo02; //学生类 public class Student { //属性 String name; int age; //方法 public void study(){ System.out.println(this.name+"学生在学习"
阅读全文
摘要:数组的使用 public class ArrayDemo3 { public static void main(String[] args) { int [] arrays = {1,2,3,4,5}; //打印全部数组元素 for (int i = 0; i < arrays.length ; i
阅读全文
摘要:方法 方法的定义 方法的调用 public class Demo1 { public static void main(String[] args) { int max = max (20,10); System.out.println(max); } public static int max (
阅读全文
摘要:package com.Jing.struct; import java.util.Scanner; public class ILU2 { public static void main(String[] args) { int[] he = {120,105,97,110,103,32,119,
阅读全文