2000-12-16 13:59:45 +08:00
|
|
|
// Class instinit2
|
2000-02-08 05:40:18 +08:00
|
|
|
// Generated on Wed Feb 2 17:52:49 PST 2000
|
|
|
|
// The instance initializer throws a checked exception. This is OK
|
|
|
|
// since the constructors declares it in its `throws' clause -- at
|
|
|
|
// least that's what the specs are saying.
|
|
|
|
|
2000-12-16 13:59:45 +08:00
|
|
|
class instinit2 {
|
2000-02-08 05:40:18 +08:00
|
|
|
|
|
|
|
String buffer = "Oink Oink!";
|
|
|
|
|
|
|
|
{
|
|
|
|
System.out.println ("Checking the oink...");
|
|
|
|
if (buffer != null)
|
|
|
|
throw new Exception ("It just oinked");
|
|
|
|
}
|
|
|
|
|
2000-12-16 13:59:45 +08:00
|
|
|
instinit2 () throws Exception
|
2000-02-08 05:40:18 +08:00
|
|
|
{
|
|
|
|
System.out.println ("Ctor");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main (String[] arg)
|
|
|
|
{
|
2000-12-16 13:59:45 +08:00
|
|
|
System.out.println ("Testing class `instinit2'...");
|
2000-02-08 05:40:18 +08:00
|
|
|
try {
|
2000-12-16 13:59:45 +08:00
|
|
|
System.out.println (new instinit2 ().buffer);
|
2000-02-08 05:40:18 +08:00
|
|
|
} catch (Exception e) {
|
|
|
|
System.out.println (e.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|