• Post Reply Bookmark Topic Watch Topic
  • New Topic

Head First Java 2nd Edition - Page 102, chapter 5  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly I'd like to apologise for my lack of understanding with this particular section of the book.

If someone who has the book, who could clearly help me understand what the author is trying to say with this particular section, would be immensely helpful to me.

The author writes:

'Then ask yourself, 'If the checkYourself() method were implemented, what test code could I write that would prove to me the method is working correctly?'

The author however writes the test code, along with the checkyourself method, checking to see it works.

What was the need of this question?

Sorry for being so stupid.

Thank you.
 
john pep
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The checkyourself method accepts string parameters.

So i'm guessing to check if it works, i could pass it some integer arguments or an argument of another type to see if it works as intended, (by not accepting anything but String)

Is that what the author is trying to make me do?

Thanks.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

'Then ask yourself, 'If the checkYourself() method were implemented, what test code could I write that would prove to me the method is working correctly?'
The author however writes the test code, along with the checkyourself method, checking to see it works.
What was the need of this question?


Probably thats a rhetoric and the author is trying to show what he meant? I do not have a copy of the book so I am guessing here.

Sorry for being so stupid.

No such thing
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!