package com.lovo.bean;
public class Student {
private int id;
private String name;
private int age;
private Book myBook;
public Student(){
}
public Student(String name,int age){
this.name = name;
this.age = age;
this.selfIntr();
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getId() {
return id;
}
public void setId(int id) {
姓名代码转换器百度 this.id = id;
}
public Book getMyBook() {
return myBook;
}
public void setMyBook(Book myBook) {
Book = myBook;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void selfIntr(){
System.out.println("我叫" + this.name + ",今年" + this.age + "岁!");
}
public void read(){
System.out.println("我在读" + myBook.bookName);
}
}
package com.lovo.bean;
public class Book {
public String bookName;
public float bookPrice;
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论