Syntax error on token(s), misplaced construct(s)
843789Feb 11 2010 — edited Feb 11 2010I am very new to Java - following a tutorial on Eclipse and Java beginners.
I am trying to type in the examples as I am being taught.
In the myScrapbook.jpage I typed:
ArrayList<Book> list = new ArrayList<Book>();
Book b1 = new Book "Great Expectations";
Book b2 = new Book "War and Peace";
Person p1 = new Person;
p1.setName("jamie");
p1.setMaximumBooks(7);
b1.setPerson(p1);
b2.setPerson(p1);
b1.setAuthor("Fitzgerald");
b2.setAuthor("Orsan Wells");
list
When I highlight and click "inspect" I am returned:
Syntax error on token(s), misplaced construct(s)
This appears on line 1 - pushing down the rest of the code by one line.
Can you see a problem?
Will it ever point to a direct line or wording in the code so the message is not so vague? Does it have to do with where I am "testing" out the code?
Help!
Thanks!