Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. //Created by Cody Smith
  2. //This program takes names and prints them backwards in a string
  3. package string_array;
  4.  
  5. public class string_array {
  6.  
  7.     public static void main(String[] args) {
  8.         String[] firstNames = { "George", "Fred", "Sam", "Mary", "Sarah", "Bella", "Joy", "Rita", "Marta", "Sue",
  9.                 "Nancy" };
  10.  
  11.         for (int i = firstNames.length - 1; i >= 0; i--) {
  12.             System.out.print(firstNames[i] + " ");
  13.         }
  14.     }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement