• Post Reply Bookmark Topic Watch Topic
  • New Topic

Test script?  RSS feed

 
Erica Splitt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the first part of my code that takes a number and reverses it. Works great no errors. I want to add a second part to verify the code and I'm totally lost.
I've looked at different examples and even tried a couple different approaches but none of them seem to work.
Here is what I have so far. ...
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erica Splitt wrote:I have the first part of my code that takes a number and reverses it. Works great no errors. I want to add a second part to verify the code and I'm totally lost.

I'm afraid I don't understand what you mean. Seems to me that you have the perfect basis for testing, since you can enter any string you like.

Or do you mean that you want to make sure that what your user enters is a NUMBER?

If that's the case, have a look at something like Integer.parseInt() or Character.isDigit(). There are quite a few possibilities, so you need to explain what you want in a bit more detail.

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