Unanticipated Exceptions
public static void main( String[] args )
{
try
{
Class myClass = Class.forName( args[0] );
FileInputStream file =
new FileInputStream( myClass.getName() + ".class" );
}
catch( Exception e )
{
System.out.println( "Can't open: ” + args[0] );
}
}
ClassNotFoundException
IOException
Previous slide
Next slide
Back to first slide
View graphic version