上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: 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) 编辑
摘要: package Mian; public class Geobject { double findArea(){ return 0; } double equalArea(Geobject s){ return this.findArea()-s.findArea(); } } package Mian... 阅读全文
posted @ 2017-04-13 20:31 苏轼的红烧肉 阅读(161) 评论(0) 推荐(0) 编辑
摘要: public class Animal { String name; public Animal() { super(); } public Animal(String name) { super(); this.name = name; } public void eat(){ System.out.println("正在吃"); } } pub... 阅读全文
posted @ 2017-04-13 18:39 苏轼的红烧肉 阅读(329) 评论(0) 推荐(0) 编辑
摘要: package Kuai; import java.util.Random; public class Person { public static Random r=new Random(); public static void sayHello(){ System.out.println("你好吗");} //这是静态块;它在加载Per... 阅读全文
posted @ 2017-04-13 17:04 苏轼的红烧肉 阅读(98) 评论(0) 推荐(0) 编辑
摘要: package Jing; public class Person { String name; static String history="5000年前是猴纸"; } package Jing; public class Shuxue { public final static double PI=3.14; public static bool... 阅读全文
posted @ 2017-04-13 15:46 苏轼的红烧肉 阅读(106) 评论(0) 推荐(0) 编辑
摘要: package Tian; public class Actor{ String name; Pet pet; package Tian; public final class Bear extends Pet { public void run(){ System.out.println("我是雄二,我喜欢蜂蜜"); } } package Tian; p... 阅读全文
posted @ 2017-04-12 14:48 苏轼的红烧肉 阅读(167) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页