Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {

        int[] intArray = { 1, 2, 3, 4 };
        Stream<int[]> singleElementStream = Stream.of(intArray);

        // OUTPUTS

        System.out.println(Arrays.toString(singleElementStream.toArray(Integer[]::new)));
        singleElementStream.toArray(); // watch it, it is Object[]
    }

}