MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

public class MainClass {

    public static void main(String[] a) {
        int[] array1 = { 1, 2, 3, 4 };
        int[] array2 = new int[array1.length];
        System.arraycopy(array1, 0, array2, 0, array1.length);

        for (int i : array2) {

            System.out.println(i);
        }
    }
}