exceptiontest.java

来自「kaffe Java 解释器语言,源码,Java的子集系统,开放源代码」· Java 代码 · 共 35 行

JAVA
35
字号
/* * This file is used by ExceptionTestClassLoader.java * * @author Benjamin Reed <breed@almaden.ibm.com> */ import java.util.*;public class ExceptionTest {  String foo( int i ) {    try {      return (String)v.elementAt( i );    } catch( Exception e ) {      System.out.println( "Success 3." );    } catch( NoClassDefFoundError e ) {      e.printStackTrace();    }    return "Success 4.";  }  Vector v = new Vector();  public ExceptionTest( String hi ) {    String args[] = { "Success 1." };    for( int i = 0; i < args.length; i++ ) {      v.addElement( args[i] );    }    for( int i = 0; i <= args.length; i++ ) {      System.out.println( foo( i ) );    }  }  public static void main(String[] argv) {}}/* Expected Output:*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?