下列哪些是合法的类定义语句
A: public class A {}
B: class A extends Exception,I0Exception {}
C: public class 1A extends Object
D: public class String {}
A: public class A {}
B: class A extends Exception,I0Exception {}
C: public class 1A extends Object
D: public class String {}
举一反三
- Java中,自定义异常代码( )。 A: public class MyException implents Exception{ } B: class MyException extends Throwable{ } C: class MyException { } D: class MyException extends Exception{ }
- Which two, inserted at line 11, will allow the code to compile?() A: public class MinMax<?>{ B: public class MinMax<? extends Number>{ C: public class MinMax<N extends Object>{ D: public class MinMax<N extends Number>{ E: public class MinMax<? extends Object>{ F: public class MinMax<N extends Integer>{
- 下列哪个类声明是正确的 ( ) A: abstract class G2 extends superClass1,superClass2{...} B: abstract public class classmates{...} C: public final class NewClass extends superClass implemnets Interface1{...} D: public abstract class String{...}
- 检查下面的代码: class E1 extends Exception{ } class E2 extends E1 { } public class Quiz6_5{ public static void main(String[] args){ try{ throw new E1(); } // --X-- } } 下列语句,哪一个可以放到--X--位置,而且保证编译成功。
- 假设C和D是接口,下列定义哪个是正确的() A: public class A implements C,D{ } B: public class A implements C implements D{ } C: public class A extends C,D{ } D: public class A extends C extends D{ }