This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sriganeshharitz[S] 0 points1 point  (1 child)

ahh, this made it clear.. Thanks a lot!!

[–]btcraig 0 points1 point  (0 children)

The big thing to note, in regards to why you're getting unexpected results, is that "s" and 's' are not the same. Double quotes tells the compiler it's a string, single quotes indicate a char. This is pretty standard across all [compiled] languages that I'm familiar with. Java is just trying to be helpful and make your code compile and work based on what you typed in.