//引用参数传递
class test13 {
public void seeBook(Book book){
System.out.println("我正在看书,信息如下 ");
System.out.println(book.getTitle());
System.out.println(book.getPageSize());
book.setTitle(“三国演义”);
book.setPageSize(5000);
}
}
class Book {
private String title;
private int pageSize;
public String getTitle() {return title;
}
public void setTitle(String title) {this.title = title;
}
public int getPageSize() {return pageSize;
}
public void setPageSize(int pageSize) {this.pageSize = pageSize;
}
}
public class test11 {
public static void main(String[] args){
test13 stu=new test13();
Book book = new Book();
book.setTitle(“红楼梦”);
book.setPageSize(6000);
stu.seeBook(book);
System.out.println(book.getTitle());
System.out.println(book.getPageSize());
}
}