Skip to Main Content
Java
book

Java

by Michael Sikora
January 2003
Beginner to intermediate content levelBeginner to intermediate
150 pages
7h 28m
English
Morgan Kaufmann
Content preview from Java
76
Chapter 6: Exceptions
[]
5
6
7
8
9
10 }
if (argl > 99 I arg2 > 99) {
throw new ArgumentTooBigException() ;
}
return argl * arg2;
multiply Method
Note that in the statement (line 6),
throw new
ArgumentTooBigException();
the
new
keyword creates a throwable object corresponding to the
ArgumentTooBigException
class. The throw keyword then throws this object. Note that the method declaration includes
the clause throws ArgumentTooBigException (line 4). Java has a requirement that any exception,
other than runtime exceptions, must be either caught by the method or specified in the throws
clause of the method. Note that a method ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JAVA Programming

JAVA Programming

K. Rajkumar
Java Programming

Java Programming

Poornachandra Sarang
Java Programming

Java Programming

Hari Mohan Pandey
Java 9 for Programmers

Java 9 for Programmers

Paul J. Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781558609099