public class BookService
{
private String[] books =
new String[]{
"疯狂Java讲义" ,
"轻量级Java EE企业应用实战",
"经典Java EE企业应用实战",
"疯狂Ajax讲义"
};
public String[] getLeeBooks()
{
return books;
}
{
private String[] books =
new String[]{
"疯狂Java讲义" ,
"轻量级Java EE企业应用实战",
"经典Java EE企业应用实战",
"疯狂Ajax讲义"
};
public String[] getLeeBooks()
{
return books;
}
}
另一个类:
private String[] books;
public void setBooks(String[] books)
{
this.books = books;
}
public String[] getBooks()
{
return books;
}
BookService bs = new BookService();
setBooks(bs.getLeeBooks());