Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //RecordType1.Java
- class RecordType1
- {
- char[] Y;
- public RecordType1 (char[] OperandArray)
- {
- this.Y = OperandArray;
- }
- }
- //RecordType2.Java
- class RecordType2
- {
- RecordType1 W;
- char[] Y;
- public RecordType2 (RecordType1 Operand1, char[] OperandArray)
- {
- this.Y = OperandArray;
- this.W = Operand1;
- }
- }
- //RecordMain.Java
- public class RecordMain
- {
- public static void main (String[] args)
- {
- char[] CollectionObject1 = {'e','f'};
- char[] CollectionObject2 = {'c','d'};
- RecordType1 RecordObject1 = new RecordType1 (CollectionObject1);
- RecordType2 X = new RecordType2 (RecordObject1, CollectionObject1);
- X.Y[0] = X.Y[1];
- X.W.Y[0] = X.W.Y[1];
- System.out.println (X.Y[1]);
- System.out.println (X.W.Y[0]);
- X.Y=CollectionObject2;
- System.out.println(Arrays.toString(X.Y));
- }
- }
- //RecordMainRepetition.Java
- 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