getinterfaces.java

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

JAVA
31
字号
interface if0 {}interface if1 {}class cl implements if0, if1 {}class GetInterfaces {    public static void main(String argv[]) {	try {	    Class c = Class.forName("cl");	    Class interfaces[] = c.getInterfaces();	    // It's all done allready :-(	    System.out.println("Hello world!");	    for(int i=0; i<interfaces.length; i++) {		System.out.println("interface" + i + ": " + interfaces[i].getName());	    }	} catch (Exception e) {	    System.out.println("Exception caught: " + e.toString());	}    }}/* Expected Output:Hello world!interface0: if0interface1: if1*/

⌨️ 快捷键说明

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