four 2 months ago
parent
commit
7ce06b3ded
69 changed files with 662 additions and 0 deletions
  1. 11 0
      day08/day08.iml
  2. 2 0
      day08/src/com/four/day08/demo01/Demo01.java
  3. 2 0
      day08/src/com/four/day08/demo01/Person.java
  4. 2 0
      day08/src/com/four/day08/demo01/Teacher.java
  5. 16 0
      day08/src/com/four/day08/demo02/a/Demo.java
  6. 14 0
      day08/src/com/four/day08/demo02/a/Student.java
  7. 2 0
      day08/src/com/four/day08/demo02/b/Demo.java
  8. 24 0
      day08/src/com/four/day08/demo03/Animal.java
  9. 18 0
      day08/src/com/four/day08/demo03/Demo.java
  10. 60 0
      day08/src/com/four/day08/demo03/Person.java
  11. 40 0
      day08/src/com/four/day08/demo04/TestTriangle.java
  12. 2 0
      day08/src/com/four/day08/demo04/Triangle.java
  13. 2 0
      day08/src/com/four/day08/demo05/Demo.java
  14. 2 0
      day08/src/com/four/day08/demo05/Employee.java
  15. 2 0
      day08/src/com/four/day08/demo06/Demo.java
  16. 32 0
      day08/src/com/four/day08/demo06/Demo1.java
  17. 2 0
      day08/src/com/four/day08/demo06/Student.java
  18. 2 0
      day08/src/com/four/day08/demo06/StudentUtils.java
  19. 2 0
      day08/src/com/four/day08/homework/Demo01.java
  20. 2 0
      day08/src/com/four/day08/homework/MyDate.java
  21. 2 0
      day08/src/com/four/day08/homework/MyInt.java
  22. 11 0
      day09/day09.iml
  23. 2 0
      day09/src/com/four/day09/demo01/Animal.java
  24. 2 0
      day09/src/com/four/day09/demo01/Cat.java
  25. 2 0
      day09/src/com/four/day09/demo01/Demo01.java
  26. 2 0
      day09/src/com/four/day09/demo02/Demo.java
  27. 2 0
      day09/src/com/four/day09/demo02/Demo01.java
  28. 2 0
      day09/src/com/four/day09/demo03/Demo.java
  29. 2 0
      day09/src/com/four/day09/demo03/Father.java
  30. 2 0
      day09/src/com/four/day09/demo03/Son.java
  31. 2 0
      day09/src/com/four/day09/demo04/Demo01.java
  32. 2 0
      day09/src/com/four/day09/demo04/Employee.java
  33. 2 0
      day09/src/com/four/day09/demo04/Manager.java
  34. 2 0
      day09/src/com/four/day09/demo05/Demo01.java
  35. 2 0
      day09/src/com/four/day09/demo05/Employee.java
  36. 2 0
      day09/src/com/four/day09/demo05/Manager.java
  37. 2 0
      day09/src/com/four/day09/demo06/Demo.java
  38. 2 0
      day09/src/com/four/day09/demo06/Person.java
  39. 2 0
      day09/src/com/four/day09/demo06/Teacher.java
  40. 2 0
      day09/src/com/four/day09/demo06/Test.java
  41. 20 0
      day09/src/com/four/day09/demo07/TestOther.java
  42. 2 0
      day09/src/com/four/day09/demo08/Animal.java
  43. 2 0
      day09/src/com/four/day09/demo08/Demo01.java
  44. 2 0
      day09/src/com/four/day09/demo08/Dog.java
  45. 30 0
      day09/src/com/four/day09/demo09/CoffeFolw.java
  46. 2 0
      day09/src/com/four/day09/demo09/Demo.java
  47. 8 0
      day09/src/com/four/day09/demo09/Student.java
  48. 93 0
      day09/src/com/four/day09/test/ElectronicsDevice.java
  49. 28 0
      day09/src/com/four/day09/test/ElectronicsDeviceTest.java
  50. 11 0
      day10/day10.iml
  51. 15 0
      day10/src/com/four/day10/demo/Demo01.java
  52. 17 0
      day10/src/com/four/day10/demo01/Demo01.java
  53. 16 0
      day10/src/com/four/day10/demo01/Mourse.java
  54. 18 0
      day10/src/com/four/day10/demo01/USB3Interface.java
  55. 44 0
      day10/src/com/four/day10/demo02/Demo02.java
  56. 2 0
      day10/src/com/four/day10/demo03/Demo01.java
  57. 2 0
      day10/src/com/four/day10/demo03/Ferrari.java
  58. 2 0
      day10/src/com/four/day10/demo03/SportsCar.java
  59. 2 0
      day10/src/com/four/day10/demo04/Demo01.java
  60. 2 0
      day10/src/com/four/day10/demo05/Demo01.java
  61. 28 0
      day10/src/com/four/day10/demo05/Demo02.java
  62. 14 0
      day10/src/com/four/day10/demo05/Person.java
  63. 2 0
      day10/src/com/four/day10/demo06/Demo.java
  64. 2 0
      day10/src/com/four/day10/demo06/Emp.java
  65. 2 0
      day10/src/com/four/day10/demo06/MyArrays.java
  66. 2 0
      day10/src/com/four/day10/homework/BankAccount.java
  67. 2 0
      day10/src/com/four/day10/homework/CreditCardAccount.java
  68. 2 0
      day10/src/com/four/day10/homework/Demo01.java
  69. 2 0
      day10/src/com/four/day10/homework/SavingsAccount.java

+ 11 - 0
day08/day08.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 2 - 0
day08/src/com/four/day08/demo01/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo01;public class Demo01 {
+}

+ 2 - 0
day08/src/com/four/day08/demo01/Person.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo01;public class Person {
+}

+ 2 - 0
day08/src/com/four/day08/demo01/Teacher.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo01;public class Teacher {
+}

+ 16 - 0
day08/src/com/four/day08/demo02/a/Demo.java

@@ -0,0 +1,16 @@
+package com.four.day08.demo02.b;
+
+import com.four.day08.demo02.a.Student;
+
+public class Demo {
+    public static void main(String[] args) {
+
+        Student s1 = new Student();
+
+        s1.a = "a";
+        //s1.b = "b";
+
+
+
+    }
+}

+ 14 - 0
day08/src/com/four/day08/demo02/a/Student.java

@@ -0,0 +1,14 @@
+package com.four.day08.demo02;
+
+public class Student {
+
+    public String a;
+
+    String b;
+
+    protected String c;
+
+    private String d;
+    
+
+}

+ 2 - 0
day08/src/com/four/day08/demo02/b/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo02.b;public class Demo {
+}

+ 24 - 0
day08/src/com/four/day08/demo03/Animal.java

@@ -0,0 +1,24 @@
+package com.four.day08.demo3;
+
+public class Animal {
+
+
+    private String name;
+    private int age;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+}

+ 18 - 0
day08/src/com/four/day08/demo03/Demo.java

@@ -0,0 +1,18 @@
+package com.four.day08.demo3;
+
+public class Demo {
+    public static void main(String[] args) {
+
+        Person person = new Person();
+
+        person.setAge(-1);
+
+        person.setName("tom");
+
+        int i1 = person.getAge() + 1;
+        person.setAge(i1);
+
+        System.out.println(person.getAge());
+
+    }
+}

+ 60 - 0
day08/src/com/four/day08/demo03/Person.java

@@ -0,0 +1,60 @@
+package com.four.day08.demo3;
+
+public class Person {
+
+    //私有的
+    private String name;
+
+    //私有的
+    private int age;
+
+    public Person() {
+    }
+
+    public Person(String name, int age) {
+        this.name = name;
+        if ( age > 0 && age < 200 ){
+            this.age = age;
+        }else{
+            //抛出异常
+            throw new IllegalArgumentException("参数异常,不符合范围");
+        }
+    }
+
+    //提供方法。
+    //设置方法 set属性名称 (第一个单词大写)
+    //set 没有返回值 有参数
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    //获取方法 get属性名称 (第一个单词大写)
+    //get 有返回值 无参数
+    public String getName() {
+        return name;
+    }
+
+    //统一的方法
+    //修饰符 public
+    public void setAge(int age) {
+        //验证
+        if ( age > 0 && age < 200 ){
+            this.age = age;
+        }else{
+            //抛出异常
+            throw new IllegalArgumentException("参数异常,不符合范围");
+        }
+//        if ( age > 0 && age < 200 ){
+//            this.age = age;
+//        }else{
+//            System.out.println("年龄不符合范围");
+//            return;
+//        }
+
+    }
+    public int getAge() {
+        return age;
+    }
+
+
+}

+ 40 - 0
day08/src/com/four/day08/demo04/TestTriangle.java

@@ -0,0 +1,40 @@
+package com.four.day08.demo04;
+
+public class Triangle {
+
+    private int a;
+    private int b;
+    private int c;
+
+    public Triangle() {
+    }
+
+    public Triangle(int a, int b, int c) {
+        //验证
+        if ( a > 0 && b > 0 && c > 0 && a+b > c && b+c > a && c+b > a  ){
+            this.a = a;
+            this.b = b;
+            this.c = c;
+        }else {
+            throw new IllegalArgumentException("参数异常");
+        }
+    }
+
+    public int getA() {
+        return a;
+    }
+
+    public int getB() {
+        return b;
+    }
+
+    public int getC() {
+        return c;
+    }
+
+    //info
+    public String getInfo(){
+        return "a=" + a + ", b=" + b + ", c=" + c;
+    }
+
+}

+ 2 - 0
day08/src/com/four/day08/demo04/Triangle.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo04;public class Triangle {
+}

+ 2 - 0
day08/src/com/four/day08/demo05/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo05;public class Demo {
+}

+ 2 - 0
day08/src/com/four/day08/demo05/Employee.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo05;public class Employee {
+}

+ 2 - 0
day08/src/com/four/day08/demo06/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo06;public class Demo {
+}

+ 32 - 0
day08/src/com/four/day08/demo06/Demo1.java

@@ -0,0 +1,32 @@
+package com.four.day08.demo06;
+
+import java.util.Arrays;
+
+public class Demo {
+    public static void main(String[] args) {
+        //静态
+        Student[] s2 = {
+                new Student("001","tom",20,100)
+        };
+
+
+        //对象数组
+        Student[] s1 = new Student[5];
+        s1[0] = new Student("202001001","周1",20,88);
+        s1[1] = new Student("202001002","周2",21,77);
+        s1[2] = new Student("202001003","周3",18,90);
+        s1[3] = new Student("202001004","周4",24,66);
+        s1[4] = new Student("202001005","周5",23,66);
+
+        //数组
+        //按照分数排序
+        //冒泡排序
+        StudentUtils.sort(s1);
+
+        //排序结果
+        //System.out.println(Arrays.toString(s1));
+        for (int i1 = 0; i1 < s1.length; i1++) {
+            System.out.println(s1[i1]);
+        }
+    }
+}

+ 2 - 0
day08/src/com/four/day08/demo06/Student.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo06;public class Student {
+}

+ 2 - 0
day08/src/com/four/day08/demo06/StudentUtils.java

@@ -0,0 +1,2 @@
+package com.four.day08.demo06;public class StudentUtils {
+}

+ 2 - 0
day08/src/com/four/day08/homework/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day08.homework;public class Demo01 {
+}

+ 2 - 0
day08/src/com/four/day08/homework/MyDate.java

@@ -0,0 +1,2 @@
+package com.four.day08.homework;public class MyDate {
+}

+ 2 - 0
day08/src/com/four/day08/homework/MyInt.java

@@ -0,0 +1,2 @@
+package com.four.day08.homework;public class MyInt {
+}

+ 11 - 0
day09/day09.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 2 - 0
day09/src/com/four/day09/demo01/Animal.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo01;public class Animal {
+}

+ 2 - 0
day09/src/com/four/day09/demo01/Cat.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo01;public class Cat {
+}

+ 2 - 0
day09/src/com/four/day09/demo01/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo01;public class Demo01 {
+}

+ 2 - 0
day09/src/com/four/day09/demo02/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo02;public class Demo {
+}

+ 2 - 0
day09/src/com/four/day09/demo02/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo02;public class Demo01 {
+}

+ 2 - 0
day09/src/com/four/day09/demo03/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo03;public class Demo {
+}

+ 2 - 0
day09/src/com/four/day09/demo03/Father.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo03;public class Father {
+}

+ 2 - 0
day09/src/com/four/day09/demo03/Son.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo03;public class Son {
+}

+ 2 - 0
day09/src/com/four/day09/demo04/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo04;public class Demo01 {
+}

+ 2 - 0
day09/src/com/four/day09/demo04/Employee.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo04;public class Employee {
+}

+ 2 - 0
day09/src/com/four/day09/demo04/Manager.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo04;public class Manager {
+}

+ 2 - 0
day09/src/com/four/day09/demo05/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo05;public class Demo01 {
+}

+ 2 - 0
day09/src/com/four/day09/demo05/Employee.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo05;public class Employee {
+}

+ 2 - 0
day09/src/com/four/day09/demo05/Manager.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo05;public class Manager {
+}

+ 2 - 0
day09/src/com/four/day09/demo06/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo06;public class Demo {
+}

+ 2 - 0
day09/src/com/four/day09/demo06/Person.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo06;public class Person {
+}

+ 2 - 0
day09/src/com/four/day09/demo06/Teacher.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo06;public class Teacher {
+}

+ 2 - 0
day09/src/com/four/day09/demo06/Test.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo06;public class Test {
+}

+ 20 - 0
day09/src/com/four/day09/demo07/TestOther.java

@@ -0,0 +1,20 @@
+package com.four.day09.dmo07;
+
+public class TestOther {
+
+
+    public static void main(String[] args) {
+        Other o = new Other();
+        new TestOther().addOne(o);
+        System.out.println(o.i);
+    }
+
+    public void addOne(final Other o){
+        //o = new Other();
+        o.i++;
+    }
+}
+
+class Other{
+    public int i;
+}

+ 2 - 0
day09/src/com/four/day09/demo08/Animal.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo08;public class Animal {
+}

+ 2 - 0
day09/src/com/four/day09/demo08/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo08;public class Demo01 {
+}

+ 2 - 0
day09/src/com/four/day09/demo08/Dog.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo08;public class Dog {
+}

+ 30 - 0
day09/src/com/four/day09/demo09/CoffeFolw.java

@@ -0,0 +1,30 @@
+package com.four.day09.demo08;
+
+public abstract class CoffeFolw {
+
+    /*
+        出现固定流程。
+         规定流程。
+         中间 可有 (自定义操作)
+     */
+
+    //加糖
+    public void make(){
+
+    }
+
+    //水
+    public void  water(){
+        System.out.println("第一步 500ml 水");
+    }
+
+    //冰
+    public void  ice(){
+        System.out.println("第二步 10块冰");
+    }
+
+    //糖
+    public abstract void sugar( int number);
+
+
+}

+ 2 - 0
day09/src/com/four/day09/demo09/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day09.demo09;public class Demo {
+}

+ 8 - 0
day09/src/com/four/day09/demo09/Student.java

@@ -0,0 +1,8 @@
+package com.four.day09.demo08;
+
+public class Student extends CoffeFolw{
+    @Override
+    public void sugar(int number) {
+        System.out.println("自己选择 " + number+"数量");
+    }
+}

+ 93 - 0
day09/src/com/four/day09/test/ElectronicsDevice.java

@@ -0,0 +1,93 @@
+package com.four.day09;
+
+import java.util.Arrays;
+
+public class ElectronicsDevice {
+    //属性
+    private String brand;
+    private String model;
+    private boolean powerStatus;
+    private int batterylevel;
+    //构造方法
+
+    public ElectronicsDevice() {
+    }
+
+    public ElectronicsDevice(String brand, String model, boolean powerStatus, int batterylevel) {
+        this.brand = brand;
+        this.model = model;
+        this.powerStatus = powerStatus;
+        setBatterylevel(batterylevel);
+        //this.batterylevel = batterylevel;
+    }
+    //set and get
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+    public boolean isPowerStatus() {
+        return powerStatus;
+    }
+
+    public void setPowerStatus(boolean powerStatus) {
+        this.powerStatus = powerStatus;
+    }
+
+    public int getBatterylevel() {
+        return batterylevel;
+    }
+
+    public void setBatterylevel(int batterylevel) {
+        if (batterylevel < 0 || batterylevel > 100) {
+            throw new IllegalArgumentException("参数有误batterylevel must be between 0 and 100");
+        }else{
+            this.batterylevel = batterylevel;
+        }
+    }
+
+    //重构toString方法
+    @Override
+    public String toString() {
+        return "\nD{品牌:"+brand+
+                "\n型号:"+model+
+                "\n电源状态:"+powerStatus+
+                "\n电池电量:"+batterylevel+
+                "}";
+    }
+
+    //方法
+    //查询所有设备详情
+    public void getElectronicsDeviceDetail(ElectronicsDevice[] ElectronicsDevices) {
+        System.out.println(Arrays.toString(ElectronicsDevices));
+    }
+
+    //打开电源
+    public void turnOn(){
+        this.powerStatus = true;
+    }
+    //关闭电源
+    public void trunOn(){
+        this.powerStatus = false;
+    }
+    //充电
+    public void charge(int batterylevel){
+        this.batterylevel =batterylevel;
+    }
+    //放电
+    public void discharge(int batterylevel){
+        this.batterylevel =batterylevel;
+    }
+}

+ 28 - 0
day09/src/com/four/day09/test/ElectronicsDeviceTest.java

@@ -0,0 +1,28 @@
+package com.four.day09;
+
+public class ElectronicsDeviceTest {
+    public static void main(String[] args) {
+        ElectronicsDevice electronicsDevice1 = new ElectronicsDevice();
+        electronicsDevice1.setBatterylevel(100);
+        //electronicsDevice1.setBrand();
+        //electronicsDevice1.setModel();
+
+        //javaee 中 自动。封装属性。
+
+        ElectronicsDevice[] e ={
+                new ElectronicsDevice("a","a1",false,100),
+                new ElectronicsDevice("b","b1",false,120),
+                new ElectronicsDevice("c","c1",false,100)
+        };
+        ElectronicsDevice electronicsDevice = new ElectronicsDevice();
+        electronicsDevice.getElectronicsDeviceDetail(e);
+        System.out.println("-------------------------");
+        ElectronicsDevice e1 = e[0];
+        System.out.println(e[0]);
+        System.out.println("-------------------------");
+        e1.turnOn();
+
+        e1.discharge(101);
+        System.out.println(e[0]);
+    }
+}

+ 11 - 0
day10/day10.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 15 - 0
day10/src/com/four/day10/demo/Demo01.java

@@ -0,0 +1,15 @@
+package com.four.day10.homework.demo;
+
+public class Demo01 {
+
+    public static void main(String[] args) {
+        //调用m1 必须符合参数。
+        //m1(1,20);
+
+
+    }
+
+    public static void m1(String s1,int a ,double b , char c ) {
+
+    }
+}

+ 17 - 0
day10/src/com/four/day10/demo01/Demo01.java

@@ -0,0 +1,17 @@
+package com.four.day10.homework.demo01;
+
+public class Demo01 {
+
+    public static void main(String[] args) {
+
+        Mourse mourse = new Mourse();
+        mourse.tranfer();
+
+        mourse.mourseOption();
+
+
+    }
+
+
+
+}

+ 16 - 0
day10/src/com/four/day10/demo01/Mourse.java

@@ -0,0 +1,16 @@
+package com.four.day10.homework.demo01;
+
+public class Mourse implements USB3Interface{
+
+
+    @Override
+    public void tranfer() {
+        int num = (int) (Math.random() * 100);
+        System.out.println("传输速率"+ num );
+    }
+
+    @Override
+    public void mourseOption() {
+        System.out.println("鼠标操作" );
+    }
+}

+ 18 - 0
day10/src/com/four/day10/demo01/USB3Interface.java

@@ -0,0 +1,18 @@
+package com.four.day10.homework.demo01;
+
+public interface USB3Interface {
+
+    //常量 psf
+    public static final int LOW = 0;
+    //public static final int HIGHT = 100;
+    int HIGHT = 100;
+
+    //抽象方法
+    //传输
+    //public abstract void tranfer();
+    void tranfer();
+
+    //鼠标操作
+    void mourseOption();
+
+}

+ 44 - 0
day10/src/com/four/day10/demo02/Demo02.java

@@ -0,0 +1,44 @@
+package com.four.day10.homework.demo02;
+
+public class Demo02 {
+
+    public static void main(String[] args) {
+        //A a = new A();
+
+        //匿名内部类
+        //A a1 = new A() {};
+
+        //静态
+        //接口名.变量
+        System.out.println(A.a);
+
+        //非静态的,创建子类对象,然后对象名.非静态成员
+        C c = new C();
+        c.m1();
+    }
+
+}
+
+interface A {
+    //静态的变量
+    public static final  int a = 100;
+
+    void m1();
+}
+interface B {
+
+}
+//多实现
+class C implements A , B {
+    public void m1() {
+        System.out.println("m1");
+    }
+}
+
+//多继承
+interface D extends B,A{
+
+}
+
+//同时继承父类实现接口
+class E  extends C implements D {}

+ 2 - 0
day10/src/com/four/day10/demo03/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo03;public class Demo01 {
+}

+ 2 - 0
day10/src/com/four/day10/demo03/Ferrari.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo03;public class Ferrari {
+}

+ 2 - 0
day10/src/com/four/day10/demo03/SportsCar.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo03;public class SportsCar {
+}

+ 2 - 0
day10/src/com/four/day10/demo04/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo04;public class Demo01 {
+}

+ 2 - 0
day10/src/com/four/day10/demo05/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo05;public class Demo01 {
+}

+ 28 - 0
day10/src/com/four/day10/demo05/Demo02.java

@@ -0,0 +1,28 @@
+package com.four.day10.demo05;
+
+import java.util.Arrays;
+
+public class Demo01 {
+
+
+    public static void main(String[] args) {
+
+        String[] arr = {"a","c","b"};
+
+        Arrays.sort(arr);
+
+        System.out.println(Arrays.toString(arr));
+
+        Person[] people = {
+                new Person("1",1),
+                new Person("2",2),
+                new Person("3",3)
+        };
+
+        //排序
+        Arrays.sort(people);
+        // cannot be cast to class java.lang.Comparable 类型不符合
+
+    }
+
+}

+ 14 - 0
day10/src/com/four/day10/demo05/Person.java

@@ -0,0 +1,14 @@
+package com.four.day10.demo04;
+
+public class Person {
+    private String name;
+    private int age;
+
+    public Person() {
+    }
+
+    public Person(String name, int age) {
+        this.name = name;
+        this.age = age;
+    }
+}

+ 2 - 0
day10/src/com/four/day10/demo06/Demo.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo06;public class Demo {
+}

+ 2 - 0
day10/src/com/four/day10/demo06/Emp.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo06;public class Emp {
+}

+ 2 - 0
day10/src/com/four/day10/demo06/MyArrays.java

@@ -0,0 +1,2 @@
+package com.four.day10.demo06;public class MyArrays {
+}

+ 2 - 0
day10/src/com/four/day10/homework/BankAccount.java

@@ -0,0 +1,2 @@
+package com.four.day10.homework;public class BankAccount {
+}

+ 2 - 0
day10/src/com/four/day10/homework/CreditCardAccount.java

@@ -0,0 +1,2 @@
+package com.four.day10.homework;public class CreditCardAccount {
+}

+ 2 - 0
day10/src/com/four/day10/homework/Demo01.java

@@ -0,0 +1,2 @@
+package com.four.day10.homework;public class Demo01 {
+}

+ 2 - 0
day10/src/com/four/day10/homework/SavingsAccount.java

@@ -0,0 +1,2 @@
+package com.four.day10.homework;public class SavingsAccount {
+}