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

dominic.smith dominic.smith at blueyonder.co.uk
Sun Oct 8 16:50:26 BST 2006


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;
    //}







More information about the bluej-discuss mailing list