Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Created by Cody Smith
- //This program takes names and prints them backwards in a string
- package string_array;
- public class string_array {
- public static void main(String[] args) {
- String[] firstNames = { "George", "Fred", "Sam", "Mary", "Sarah", "Bella", "Joy", "Rita", "Marta", "Sue",
- "Nancy" };
- for (int i = firstNames.length - 1; i >= 0; i--) {
- System.out.print(firstNames[i] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement