Advertisement
apez1

Term 1: Lesson 29 - Coding Activity 2

Oct 24th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class Lesson_29_Activity_Two {
  2.  
  3.     public static String [] list = {"every", "nearing", "checking", "food", "stand", "value"};
  4.    
  5.     public static void main(String[] args) {
  6.        
  7.     String [] newlist = new String[list.length];
  8.                
  9.        
  10.     String rev = "";
  11.    
  12.     for(int j = 0; j < list.length; j++) {
  13.                    
  14.            
  15.             for(int i = list[j].length()-1; i >= 0; i--) {
  16.        
  17.                 rev = rev + list[j].charAt(i);
  18.        
  19.             }
  20.            
  21.                 newlist[j] = rev;
  22.                 rev = "";
  23.                            
  24.     }
  25.    
  26.  
  27.     for(int x = 0; x < newlist.length; x++) {
  28.         System.out.println(newlist[x]);
  29.    
  30.             }
  31.    
  32.         }
  33.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement