Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Storing Names in a string array and then printing them in reverse order.
- // Renee Waggoner
- // July 17, 2019
- // Special Requirements: None
- package string_array;
- public class FirstNames {
- public static void main(String[] args) {
- // storing names in array
- String firstNames[] = new String[]{"George", "Fred", "Sam", "Mary", "Sarah", "Bella", "Joy", "Rita", "Marta", "Sue", "Nancy"};
- //prints in reverse order
- for(int i = firstNames.length - 1 ; i >= 0 ; i--){
- System.out.println(firstNames[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement