0% found this document useful (0 votes)
13 views2 pages

Java Runnable and Stream Example

Uploaded by

nishanthverma09
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Java Runnable and Stream Example

Uploaded by

nishanthverma09
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sample Code (JAVA) - Page 1

// Java: simple Runnable + stream example import [Link].*; import [Link].*;


public class Example { public static void main(String[] args) { Runnable r = (
[Link]("Hello from thread!"); new Thread(r).start(); List<Int
Sample Code (JAVA) - Page 2

nums = [Link](1,2,3,4,5); int sum =


[Link]().mapToInt(Integer::intValue).sum(); [Link]("sum = " + sum
} }

SAMPLE / NOT FOR OFFICIAL USE - Generated by ChatGPT

You might also like