Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static void main(String[] args) {
        Set<Integer> numberSet = new HashSet<Integer>() {
            {
                add(1);
                add(2);
                add(3);
            }
        };
        Stream<Integer> collectionStream = numberSet.stream();

        System.out.println(Arrays.toString(collectionStream.toArray()));
    }

}