IntStream of(int t)
returns a sequential IntStream containing a single element.
of
has the following syntax.
static IntStream of(int t)
The following example shows how to use of
.
import java.util.stream.IntStream; public class Main { public static void main(String[] args) { IntStream i = IntStream.of(1); i.forEach(System.out::println); } }
The code above generates the following result.