摘要: package Shape; /* * 【练习题】1.抽象类与继承 设计一个能细分为矩形、三角形、圆形和椭圆形的“图形”类。 使用继承将这些图形分类,找出 package Shape; public class Rec extends Shapee{ int width; int height; public void draw(){ System.out.println("矩形... 阅读全文
posted @ 2017-04-14 19:34 苏轼的红烧肉 阅读(426) 评论(0) 推荐(0) 编辑
摘要: package oop5; public class Student { String no; String name; int deg; static int sum=0; static int num=0; public Student(String no, String name, int deg) { super(); this.no = no; this.n... 阅读全文
posted @ 2017-04-14 19:14 苏轼的红烧肉 阅读(292) 评论(0) 推荐(0) 编辑
摘要: package ab2; public abstract class Vehicle { public abstract String nowheel(); } package ab2; public class Car extends Vehicle{ public String nowheel(){ String l="四个轮子"; ... 阅读全文
posted @ 2017-04-14 18:44 苏轼的红烧肉 阅读(123) 评论(0) 推荐(0) 编辑
摘要: package oop3; public class Hero { String name; int boold; int rade; int chuan; public Hero(String name) { super(); this.name = name; } public void chushi(int chuan) { if(chu... 阅读全文
posted @ 2017-04-14 10:31 苏轼的红烧肉 阅读(427) 评论(0) 推荐(0) 编辑
摘要: package oop1; /*1.编写出一个通用的人员类(Person),该类具有姓名(Name)、年龄(Age)、性别(Sex)等域。 然后对Person 类的继承得到一个学生类(Student), 该类能够存放学生的5门课的成绩,并能求出平均成绩。 最后在Main函数中对student类的功能进行验证。*/ public class Person { String name; int ag... 阅读全文
posted @ 2017-04-14 09:10 苏轼的红烧肉 阅读(288) 评论(0) 推荐(0) 编辑