-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmohit_java.java
More file actions
42 lines (39 loc) · 798 Bytes
/
mohit_java.java
File metadata and controls
42 lines (39 loc) · 798 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
34
35
36
37
38
39
40
41
42
import java.util.Scanner;
class mohit_java{
void func1()
{
try
{
int ar[]=new int[5];
Scanner sc=new Scanner(System.in);
System.out.println("Enter elements in array");
for(int i=0;i<=5;i++)
{
ar[i]=sc.nextInt();
}
System.out.println("---------------Array elements------------------");
for(int i=0;i<5;i++)
{
System.out.println(ar[i]);
}
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("array problem occur ");
}
catch(Exception e)
{
System.out.println("division problem occur ");
}
}
void func2()
{
System.out.println("Second function is working");
}
public static void main(String args[])
{
mohit_java obj=new mohit_java();
obj.func1();
obj.func2();
}
}