class exe18 extends Exception
{
private int detail;
exe18()
{
System.out.println("default");
}
exe18(int detail)
{
this.detail=detail;
}
public String toString()
{
return"myexception["+detail+"]";
}
static void compute(int detail) throws exe18
{
System.out.println("called compute("+detail+")");
if(detail>10)
throw new exe18(detail);
System.out.println("normal exit");
}
}
class exe19
{
public static void main(String args[])
{
try
{
exe18.compute(8);
exe18.compute(54);
}
catch(exe18 e)
{
System.out.println("caught "+e);
System.out.println(e.toString());
}
}
}
Subscribe to:
Post Comments (Atom)
MY HIT COUNTER
Blog Archive
-
▼
2009
(38)
-
▼
November
(27)
- few programs on bank project
- customer identification number
- bank programs
- min balance program in oracle
- cards balance
- real time programs in bank project
- real time registration example
- Creation of tables in oracle
- practice quries
- quries
- reverse number
- throws exception
- throws exception
- divide by zero
- array index
- length of a string name
- no parameters to string
- print two parameters
- abstract class in core java
- inside area of rectangle
- area of rectangle
- three string parameters
- class b extends a
- incremeting numbers
- sum of three parameters
- box program
- strings
-
▼
November
(27)
Custom Search
No comments:
Post a Comment