具有不同数据类型的数组,即字符串和整数。(Objectorientend)
例如,我有3本书:,,,。Booknumber (int)
Booktitle (string)
Booklanguage (string)
Bookprice (int)
现在,我想要一个名为 .我通过以下方式获取我设置的数据:books[3][4]
setBooknumber
Book1.getBooknumber(), Book1.getBooktitle(),...,Book3.getBookprice().
我如何意识到这一点: .books[3][4] array
我不能叫它。因为我不能进入它。我不希望书号是字符串,也不是书价。请问我如何意识到这一点?String books[][] = new String [3][4]
Booknumber (int)
进一步阐述它。我有2节课:书本和书UI。
书
public class book{
String Booktitle, Booklanguage;
int Booknumber, Bookprice;
//constructor
//get
//set
}
图书用户界面
public class bookUI
{
public static void main(String arg[])
{
book book1 = new book();
book book2 = new book();
book book3 = new book();
book1.setBooktitle();
...
book3.setBookprice();
//Here I want to have books[3][4] Array. And gettin the data via book1.get...book3.get into the array
}
}