根据UML图,写出Java程序的代码
展开全部
public interface ILeanable{
public void stuy();
}
public interface ITeacher{
public void teach();
}
public class Person{
String name;
}
public class Student extends Person implements ILeanable{
int age;
String address;
}
public class Teacher extends Person implements ITeacher{
String major;
int age;
}
追答
public class MyClass{
String ClassName;
int StuNum;
public void addStudent(Student stud){
}
}
public class Student{
long StudentID;
String StudentName;
String PassWord;
public String getName(){
return StudentName;
}
public void changePassWord(String newPWD){
this.PassWord = newPWD;
}
}
//自己应该会写了吧,是作业吗
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
class Person {
public String name;
}
interface ILeanale{
public void study();
}
interface ITeacher{
public void teach();
}
class Student extends Person implements ILeanale {
private int age;
private String address;
@Override
public void study() {
// TODO Auto-generated method stub
public String name;
}
interface ILeanale{
public void study();
}
interface ITeacher{
public void teach();
}
class Student extends Person implements ILeanale {
private int age;
private String address;
@Override
public void study() {
// TODO Auto-generated method stub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |