Name: Anonymous 2011-06-03 19:02
Any Javafags here?
So I'm trying too write a program that will print the letters of a string backwards on each line, but I can only get it too print the last letter of the string infinitely. Can anyone show me how I would get the result I want?
This is what I wrote so far:
String word = "anything";
int length = word.length();
char letter = word.charAt(length-1);
while(length > 0)
System.out.println(letter);
I'm trying to teach my self java, so any help is much appreciated.
So I'm trying too write a program that will print the letters of a string backwards on each line, but I can only get it too print the last letter of the string infinitely. Can anyone show me how I would get the result I want?
This is what I wrote so far:
String word = "anything";
int length = word.length();
char letter = word.charAt(length-1);
while(length > 0)
System.out.println(letter);
I'm trying to teach my self java, so any help is much appreciated.