-4

enter image description here

This is my code, but the system said

cannot find symbol in this code "Book[ ] books = new Book[size];".

How I can fix it?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199

1 Answers1

1

at file start, you are probably missing a:

import something.something.Book;

in eclipse, go to error line, control+1, Import ... (first item of popup item). Otherwise, you are missing the whole Book class:

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;
    }
}
Exceptyon
  • 1,584
  • 16
  • 23
  • I try to import it but it said "package something.something does not exist" – Haner Zhang Apr 14 '16 at 10:29
  • yeah, "something.something" was a placeholder, you must put there the name of the package your class is in (first line of the file you posted says something like package "*something.something*";) – Exceptyon Apr 14 '16 at 10:32