-
Notifications
You must be signed in to change notification settings - Fork 129
/
51 User Defined.txt
45 lines (35 loc) · 945 Bytes
/
51 User Defined.txt
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
43
44
45
================================================================================
ExceptionDemo.java
================================================================================
package com.telusko;
public class ExceptionDemo
{
public static void main(String[] args)
{
int i,j;
i=8;
j=9;
try
{
int k = i/j;
if(k == 0)
throw new TeluskoException("this is not possible");
System.out.println(k);
}
catch(TeluskoException e)
{
System.out.println("Error " + e.getMessage());
}
}
}
================================================================================
TeluskoException.java
================================================================================
package com.telusko;
public class TeluskoException extends Exception
{
public TeluskoException(String s)
{
super(s);
}
}