forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest_Throws.java
More file actions
33 lines (25 loc) · 739 Bytes
/
Test_Throws.java
File metadata and controls
33 lines (25 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Test_Throws {
/**
* @param args
* @throws InterruptedException
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws InterruptedException, NumberFormatException, IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int sum = 0;
int a[] = new int[5];
System.out.println("Elements of array are:");
for (int i = 1; i < a.length; i++) {
a[i] = Integer.parseInt(br.readLine());
sum = sum + a[i];
}
Thread.sleep(3000);
System.out.println("Sum is: " + sum);
}
}