[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
Back to Building Graphical Programs. On to Inheritance and Interfaces.
Held Monday, February 8
Summary
Integer, Double
and friends.
Contents
Handouts
Notes
hadError method of SimpleInput to check
whether there was an error in input.
throws the exception,
as in
public int MyCoolMethod()
throws IOException, NumberFormatException {
...
} // MyCoolMethod()
try clause.
catch clause.
try {
// stuff that may have problems
}
catch (ExceptionClass e1) {
// Handle one type of exception
}
catch (AnotherExceptionClass e2) {
// Handle another type of exception
}
finally {
// Clean up code that is always executed.
}
java.io.IOException and
java.lang.NumberFormatException.
throw new MyException(message);
throws clause, as in
public static void teach()
throws ClassOverException {
...
} // teach()
Exception class.
Later, we'll see how to define our own exceptions.
Integer class can build an
Integer object from a string.
intValue method extracts the integer value.
java.lang.Integer,
java.lang.Double, and many many more.
Integer.MIN_VALUE and
Integer.MAX_VALUE. (The same is true for other types.)
intValue
(and related things).
Do X3.5 and X3.6.
History
Back to Building Graphical Programs. On to Inheritance and Interfaces.
[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS152/99S/Outlines/outline.09.html
Source text last modified Fri Mar 12 13:07:32 1999.
This page generated on Fri Mar 12 13:12:30 1999 by SiteWeaver. Validate this page's HTML.
Contact our webmaster at rebelsky@math.grin.edu