上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: 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)
摘要: 1 package duoTai02; 2 /* 3 多态中成员访问特点 4 成员变量:编译看左边,执行看左边 5 成员方法:编译看左边,执行看右边 6 7 原因:因为成员方法有重写,而成员变量没有 8 */ 9 public class AnimalDemo { 10 public static 阅读全文
posted @ 2021-01-18 22:18 找不到北的北 阅读(314) 评论(0) 推荐(0)
摘要: 1 package duoTai02; 2 3 public class Animal { 4 5 public int age = 40; 6 7 public void eat(){ 8 System.out.println("动物吃东西"); 9 } 10 } 1 package duoTai 阅读全文
posted @ 2021-01-18 22:16 找不到北的北 阅读(107) 评论(0) 推荐(0)
摘要: 1 package duoTai01; 2 3 public class Animal { 4 5 public void eat(){ 6 System.out.println("动物吃东西"); 7 } 8 } 1 package duoTai01; 2 3 public class Cat e 阅读全文
posted @ 2021-01-18 22:15 找不到北的北 阅读(40) 评论(0) 推荐(0)
摘要: 1 package Import01; 2 3 public class Phone { 4 public void call(){ 5 System.out.println("打电话呗"); 6 } 7 } 1 package Import02; 2 3 import Import01.Phone 阅读全文
posted @ 2021-01-04 21:53 找不到北的北 阅读(79) 评论(0) 推荐(0)
摘要: 1 package studentManageDemo; 2 /* 3 学生类 4 Alt+Ins 根据自己的需要进行选择 5 */ 6 public class Student { 7 //学号 8 private String sid; 9 //姓名 10 private String name 阅读全文
posted @ 2020-12-28 22:00 找不到北的北 阅读(94) 评论(0) 推荐(0)
摘要: 1 package ToStudentDemo01; 2 /* 3 学生类 4 */ 5 public class Student { 6 private String name; 7 private int age; 8 9 public Student(){}; 10 11 public Stu 阅读全文
posted @ 2020-12-28 17:18 找不到北的北 阅读(139) 评论(0) 推荐(0)
摘要: 1 package Array; 2 3 import java.util.ArrayList; 4 5 /* 6 需求: 7 创建一个存储字符串的集合,存储3个字符串元素,使用程序实现在控制台遍历该集合 8 思路: 9 1.创建集合对象 10 2.往集合中添加字符串对象 11 3.遍历集合,首先要 阅读全文
posted @ 2020-12-19 21:59 找不到北的北 阅读(177) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 13 下一页