Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;

public class Main {

    public static void main(String[] args) {

        Short shortArr[] = new Short[] { 1, 2, 15, 50, 100 };

        // copy the array into another Number array
        Number[] arr2 = Arrays.copyOf(shortArr, 5, Number[].class);

        System.out.println(Arrays.toString(arr2));

    }
}