|
Authored by: Anonymous on Monday, May 21 2012 @ 08:33 PM EDT |
An "exception" is both a run-time event, and the name for a Java
object
that describes that event. Like all Java objects, this exception object is an
instance of a class, and the class defines what kind of data is stored in
the object. All Java exception classes are subtypes of a class called
java.lang.Throwable, and most are subclasses of java.lang.Exception. For
example, attempting to open a file might cause a
java.io.FileNotFoundException object to be created and thrown. Java
code can throw exception objects explicitly by executing a "throw
statement". Some exceptions are also thrown automatically by the Java
VM in certain situations (java.lang.NullPointerException, for example).
Anyway, an "exception is thrown" only while the program is running. I
suspect Judge Alsup is actually asking the parties about "throws
clauses",
which are a way for a method to declare that it might throw an exception
of a certain type. The caller of the method must then make some
provision for handling exceptions of that type--either by "catching"
and
handling them, or by putting the same "throws clause" in the calling
method's signature too.
So I think Judge Alsup is asking the parties to tell him about these
"throws
clauses", and how many of them there are, whether they are essential for
interoperability (they are), etc. Similarly for "interfaces", which
are what in
C++ would be called an "abstract base class". An example of an
interface
might be java.lang.Comparable, which a class should implement if its
instances can be compared (e.g. to sort them), or java.io.Serializable if the
class can load and save itself in a stream of binary data. "Implementing
an interface" means the class has an "is-a" (inheritance)
relationship with
the interface. So a BigInteger class "is a" Comparable type, and a
PurchaseOrder "is a" Serializable type. But to fulfill the contract
of being a
Comparable, the BigInteger class must implement whatever methods are
declared in the java.lang.Comparable interface (I don't recall, but probably
just a Compare method returning an integer).
Generics complicate this story a little further, but the same basic concepts
apply to them.
[ Reply to This | Parent | # ]
|
|
Authored by: hardmath on Tuesday, May 22 2012 @ 10:27 AM EDT |
There's a potentially useful summary of Apache Harmony
information at
jdocs.com for various APIs.
Specifically the Apache
Harmony 5.M5 counts are:
Classes: 2879
Enums: 14
Interfaces:
956
Errors: 28
Exceptions: 427
--- "Prolog is an efficient
programming language because it is a very stupid theorem prover." -- Richard
O'Keefe [ Reply to This | Parent | # ]
|
|
|
|
|