Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Concurrency and Multithreading /Examples /FindSumOfNumbers.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Concurrency and Multithreading/Examples/FindSumOfNumbers.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Concurrency%20and%20Multithreading/Examples/FindSumOfNumbers.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Concurrency and Multithreading/Examples/FindSumOfNumbers.java'
-
curl -L -o FindSumOfNumbers.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Concurrency%20and%20Multithreading/Examples/FindSumOfNumbers.java
581 Bytes
| /** | |
| * FindSumOfNumbers will count the sum of the number from 1 to the parameter | |
| * countUntil and then write the result to the console. | |
| * | |
| * FindSumOfNumbers is the task which will be performed | |
| * | |
| * @author Akash Das | |
| * | |
| */ | |
| public class FindSumOfNumbers implements Runnable { | |
| private final long countUntil; | |
| FindSumOfNumbers(long countUntil) { | |
| this.countUntil = countUntil; | |
| } | |
| public void run() { | |
| long sum = 0; | |
| for (long i = 1; i < countUntil; i++) { | |
| sum += i; | |
| } | |
| System.out.println(sum); | |
| } | |
| } |