[Bluej-discuss] Please help - cannot resolve symbol - exercise 2.74
dominic
dominic.smith at blueyonder.co.uk
Sun Oct 8 18:33:50 BST 2006
AHH,
Yes that is exactly what I did wrong.
I am a little bit embarrased now.
thanks for your time
dominic
Michael Kölling wrote:
> Hi Dominic,
>
> It helps being a bit more precise: when exactly do you get the error
> -- when you compile, or when you are trying to invoke a method?
>
> I am guessing that it is on invocation. If that is the case, then the
> most likely problem is that you wrote the author's name without
> double-quotes. The name is a Sting, and Strings in Java are always
> written with double-quotes. That is, write
>
> "Shakespeare"
>
> rather than
>
> Shakespeare
>
> Regards,
>
> Michael
>
>
>
>
> On 8 Oct 2006, at 16:50, 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
>
>
>
>
> ---------------------------------------------------------------------------------------------------
>
> Text inserted by Platinum 2006:
>
> This message has NOT been classified as spam. If it is unsolicited
> mail (spam), click on the following link to reclassify it:
> http://127.0.0.1:6083/Panda?ID=pav_1108&SPAM=true
> ---------------------------------------------------------------------------------------------------
>
>
>
More information about the bluej-discuss
mailing list