摘要:
1 package InterfacePlayerAndCoach; 2 3 public abstract class Person { 4 private String name; 5 private int age; 6 7 public Person() { 8 } 9 10 public 阅读全文
posted @ 2021-02-22 20:10
找不到北的北
阅读(173)
评论(0)
推荐(0)
摘要:
1 package InterfaceCat; 2 3 public interface Jumpping { 4 public abstract void jump(); 5 } 1 package InterfaceCat; 2 3 public abstract class Animal { 阅读全文
posted @ 2021-02-22 20:06
找不到北的北
阅读(115)
评论(0)
推荐(0)
摘要:
1 package InterfaceAndClass; 2 3 public interface Inter1 { 4 } package InterfaceAndClass; public interface Inter2 { } 1 package InterfaceAndClass; 2 3 阅读全文
posted @ 2021-02-22 20:04
找不到北的北
阅读(53)
评论(0)
推荐(0)
摘要:
package InterfaceAndAbstract;/* 抽象类和接口的区别 成员区别 抽象类 变量,常量;有构造方法;有抽象方法,也有非抽象方法 接口 常量;抽象方法 关系区别 类与类 继承,单继承 类与接口 实现,可单实现,也可以多实现 接口与接口 继承,单继承,多继承 设计理念的区别 抽 阅读全文
posted @ 2021-02-22 20:03
找不到北的北
阅读(66)
评论(0)
推荐(0)
摘要:
1 package Interface01; 2 /* 3 定义了一个接口 4 */ 5 public interface Jumpping { 6 7 public abstract void jump(); 8 } 1 package Interface01; 2 3 public class 阅读全文
posted @ 2021-02-22 20:01
找不到北的北
阅读(51)
评论(0)
推荐(0)
摘要:
1 package Interface; 2 3 public interface Inter { 4 5 public int num = 10; 6 public final int num2 = 20; 7 8 int num3 = 30; 9 10 public abstract void 阅读全文
posted @ 2021-02-22 19:59
找不到北的北
阅读(50)
评论(0)
推荐(0)
摘要:
1 package duoTai08; 2 3 public abstract class Animal { 4 private int age = 20; 5 private final String city = "北京"; 6 7 public Animal(){} 8 9 public An 阅读全文
posted @ 2021-02-22 19:57
找不到北的北
阅读(64)
评论(0)
推荐(0)
摘要:
1 package duoTai07; 2 /* 3 在java中,一个没有方法体的方法应该定义为抽象方法,而类中如果有抽象方法,该类必须定义为抽象类 4 5 抽象类和抽象方法必须使用abstract关键字修饰 6 public abstract class 类名{} 7 public abstra 阅读全文
posted @ 2021-02-22 19:55
找不到北的北
阅读(62)
评论(0)
推荐(0)
摘要:
1 package duoTai06; 2 3 public class Animal { 4 private String name; 5 private int age; 6 7 public Animal() { 8 } 9 10 public Animal(String name, int 阅读全文
posted @ 2021-02-22 19:53
找不到北的北
阅读(58)
评论(0)
推荐(0)
摘要:
1 package duoTai05; 2 3 public class Cat extends Animal{ 4 5 6 public void eat(){ 7 System.out.println("猫吃鱼"); 8 } 9 10 public void playGame(){ 11 Sys 阅读全文
posted @ 2021-02-22 19:51
找不到北的北
阅读(108)
评论(0)
推荐(0)
摘要:
1 package duoTai04; 2 3 public class Cat extends Animal { 4 5 @Override 6 public void eat(){ 7 System.out.println("猫吃鱼"); 8 } 9 10 public void playGam 阅读全文
posted @ 2021-02-22 19:49
找不到北的北
阅读(83)
评论(0)
推荐(0)