• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reversing a string?  RSS feed

 
Dylan Valic
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi for my project I have to reverse a string in Java and I am having some trouble. I am getting an error on my code. On line 10 it says "in cannot be resolved" how do I fix this? Here is the link to my code http://pastebin.com/Vz9DVu1u Also here is what I have to do for my project just in case I am trying to do the wrong thing "Write a program called ReverseString, which prompts user for a String, and stores and prints the reverse of the String. Have the user input a string into an input box Output the string through a message box." Thanks in advanced
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dylan Valic wrote:On line 10 it says "in cannot be resolved"

Because you have nothing in your program called 'in'.

'input' perhaps?

Winston
 
Liutauras Vilda
Marshal
Posts: 4660
320
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And don't give variable name as a string, it is rather confusing. userInput would be a bit better.
 
Liutauras Vilda
Marshal
Posts: 4660
320
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!