Skip to content

Instantly share code, notes, and snippets.

@GrantSchiller
Last active January 3, 2016 10:19
Show Gist options
  • Save GrantSchiller/8449122 to your computer and use it in GitHub Desktop.
Save GrantSchiller/8449122 to your computer and use it in GitHub Desktop.
// Reverses an array of integers.
public class reversearray {
public static void main(String[] args){
String input = "I was the shadow of the waxwing slain By the false azure in the windowpane I was the smudge of ashen fluff--and I Lived on, flew on, in the reflected sky, And from the inside, too, I'd duplicate Myself, my lamp, an apple on a plate: Uncurtaining the night, I'd let dark glass Hang all the furniture above the grass, And how delightful when a fall of snow Covered my glimpse of lawn and reached up so As to make chair and bed exactly stand Upon that snow, out in that crystal land!";
char[] inputArray = input.toCharArray();
for (int i = inputArray.length-1; i >= 0 ; i--){
System.out.print(inputArray[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment