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