Advertisement
bungfaz46

membuat array

Jul 3rd, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.34 KB | None | 0 0
  1. package array;
  2.  
  3. public class Array {
  4.     public static void main(String[] args) {
  5.         String[] nama1 = {"Budi","Adi","Endra","Ali"};
  6.          String[] nama2 = {"Bermain","Bernyanyi","Berenang","Berpegian"};
  7.           String[] nama3 = {"Dengan","Dan","Di","Mereka"};
  8.            String[] nama4 = {"Mail","Kebun","Sungai","Karoke"};
  9.             String[] nama5 = {"Sampai","Malam","Pagi","Siang"};
  10.         System.out.print(nama1[0]);
  11.         System.out.print(" -  ");
  12.         System.out.print(nama2[2]);
  13.          System.out.print(" -  ");
  14.          System.out.print(nama3[2]);
  15.           System.out.print(" -  ");
  16.           System.out.print(nama5[0]);
  17.            System.out.print(" -  ");
  18.           System.out.println(nama5[3]);
  19.           // sesion kedua
  20.           System.out.print(nama1[2]);
  21.            System.out.print(" -  ");
  22.           System.out.print(nama3[1]);
  23.             System.out.print(" -  ");
  24.           System.out.print(nama1[3]);
  25.           System.out.print(" -  ");
  26.           System.out.print(nama2[1]);
  27.            System.out.print(" -  ");
  28.           System.out.print(nama3[2]);
  29.            System.out.print(" -  ");
  30.           System.out.print(nama4[3]);
  31.           System.out.print(" -  ");
  32.           System.out.print(nama5[0]);
  33.           System.out.print(" -  ");
  34.           System.out.print(nama5[1]);
  35.          
  36.     }
  37.    
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement