[Bluej-discuss] Please help - cannot resolve symbol - exercise 2.74

Colleen Penrowley cpen at telus.net
Sun Oct 8 17:38:44 BST 2006


Dominic,

Your code looks fine. Based on your comment I suspect you're not putting 
quotes around the strings you pass to the constructor. When entering 
strings use "Kolling", "Objects First" etc.

Colleen


At 04:50 PM 10/8/2006 +0100, dominic.smith wrote:
>Hi list
>
>I am about 10 hours into learning java. I have been working through
>chapter 2 of the evaluation pdf's (I have ordered the book, but i am
>still waiting for it, amazon...)
>
>I hit a bit of stumbling block on exercise 2.74 when working on an class
>exercise that involves adding 2 accessor methods that return author and
>title fields.
>
>i keep getting an error saying it cannot resolve the symbol (author name
>I enter etc).
>
>No doubt I have made a very obvious school boy error. Please help, even
>cryptic hints would be good.
>
>dominic
>
>
>Code:
>________________________________________________________________________
>  class Book
>{
>     // The fields.
>     private String author;
>     private String title;
>
>     /**
>      * Set the author and title fields when this object
>      * is constructed.
>      */
>     public Book(String bookAuthor, String bookTitle)
>     {
>         author = bookAuthor;
>         title = bookTitle;
>     }
>
>     // Add the methods here ...
>
>     public String getAuthor()
>     {
>         return author;
>     }
>
>     public String getTitle()
>     {
>         return title;
>     }
>//commented the following out as it did not seem to help!
>// public void setBook(String bookAuthor, String bookTitle)
>     //{
>         //author=bookAuthor;
>         //title=bookTitle;
>     //}
>
>
>
>
>
>_______________________________________________
>mailing list bluej-discuss at bluej.org
>To unsubscribe or change your preferences, go to
>http://lists.bluej.org/mailman/listinfo/bluej-discuss




More information about the bluej-discuss mailing list