Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RecordMainRepetition
- {
- public static void main (String[] args)
- {
- int maxValue = 5;
- //Versi Pertama
- for (int i = 1; i <= maxValue; i++)
- {
- System.out.println (i + "\t" + Math.log(i));
- }
- //Versi Kedua
- int[] Collection = new int[]{1,2,3,4,5};
- for (int Subscript : Collection)
- {
- System.out.println (Collection[Subscript] + "\t" + Subscript);
- }
- //Versi Kedua
- String[] CollectionString = new String[] {"a","b","c","d","e"};
- for (String SubscriptValue : CollectionString)
- {
- System.out.println (CollectionString + "\t" + SubscriptValue);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement