Lesson 9, Syntax error on token "&...

Martin
2012-02-09
2013-04-09
  • Martin
    Martin
    2012-02-09

    In scrapbook, I get a syntax error when I try to specify the type Book of my ArrayList.  Here is the code:

    ArrayList<Book> list = new ArrayList<Book>();
    Book b1 = new Book("Great Expectations");
    Book b2 = new Book("War and Peace");
    list.add(b1);
    list.add(b2);
    list

    The error is:
    Syntax error on token "<", invalid AssignmentOperator

    Installed I have:
    jdk1.7.0
    jre7
    eclipse 3.02

    Any help or suggestions, greatly appreciated as I'd like to move to lesson 10
    Thanks.

     
  • Martin
    Martin
    2012-02-09

    This has been resolved.  I had two installations of the jdk, x86 and x64 - I uninstalled everything - and reinstalled cleanly.  All fixed.