aldes182

RecordMainRepetition

Jan 16th, 2021
674
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class RecordMainRepetition
  2. {
  3.     public static void main (String[] args)
  4.     {
  5.         int maxValue = 5;
  6.  
  7.        //Versi Pertama
  8.         for (int i = 1; i <= maxValue; i++)
  9.         {
  10.            System.out.println (i + "\t" + Math.log(i));
  11.         }
  12.  
  13.         //Versi Kedua
  14.         int[] Collection = new int[]{1,2,3,4,5};
  15.         for (int Subscript : Collection)
  16.         {
  17.            System.out.println (Collection[Subscript] + "\t" + Subscript);
  18.         }
  19.  
  20.         //Versi Kedua
  21.         String[] CollectionString = new String[] {"a","b","c","d","e"};
  22.         for (String SubscriptValue : CollectionString)
  23.         {
  24.            System.out.println (CollectionString + "\t" + SubscriptValue);
  25.         }
  26.     }  
  27. }
RAW Paste Data