在Java数组中找不到符号

时间:2016-04-14 10:01:48

标签: java arrays

enter image description here

这是我的代码,但系统说

  

在此代码中找不到符号" Book[ ] books = new Book[size];"。

我该如何解决?

1 个答案:

答案 0 :(得分:1)

在文件开头,您可能错过了:

import something.something.Book;
<>在eclipse中,转到错误行,控制+ 1,导入...(弹出项目的第一项)。 否则,您错过了整个Book类:

class Book {
    private String title;
    private int isbn;
    private int quantity;

    public Book(String title, int isbn, int quantity) {
        this.title = title;
        this.isbn = isbn;
        this.quantity = quantity;
    }
}
相关问题