我的文件名中有一个 json:test.json
{books:{"name":"XXXXX","isbn":98892}}
{books:{"name":"YYYYY","isbn":64728}}
{books:{"name":"ZZZZZ","isbn":19837}}
这是我的豆类
class Books{
private String name;
private int isbn;
//getter and setter methods
我的主要课程
Gson gson = new Gson();
try {
BufferedReader br= new BufferedReader(new FileReader("C:\\test.json"));
Books m = gson.fromJson(br, Books.class);
System.out.printf("%s",m.getName());
System.out.printf("\t%d",m.getIsbn());
我只能打印第一行,如果我必须解析其他行,我该怎么办?