SHARE
TWEET

Untitled

a guest Sep 14th, 2017 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package arraypractice3;
  2.  
  3. public class ArrayPractice3 {
  4.     public static void main(String[] args) {
  5.         int[] valA   = { 13, -22,  82,  17};
  6.         System.out.println("Original array:");
  7.         for (int i = 0; i < valA.length; i++)
  8.         {
  9.             System.out.print(valA[i] + ",");
  10.         }
  11.         System.out.println(); // new line
  12.         System.out.println("Reversed array:");
  13.         for (int temp = valA.length - 1; temp >= 0; temp--)
  14.         {
  15.             System.out.print(valA[temp] + ",");
  16.         }
  17.         System.out.println(); // new line
  18.     }
  19. }
RAW Paste Data
Top