题目内容

在Java的异常处理中,用户自定义的常类应该是( )的子类

A. Exception
B. Throwable
C. Error
D. RuntimeException

查看答案
更多问题

定义一个名为Key的类,使之不能被继承,应选( )

A. class Key{}
B. native class Key{}
C. class Key{final;}
D. final class Key{}

下列方法中,不属于String类的方法是( )

A. toLowerCase()
B. valueOf()
C. charAt()
D. append

如变量a是String类型的数据,那么表达式(a+a)的类型是( )

A. char
B. String
C. int
D. long

下列代码执行后,屏幕上显示的应是( )public class Test {public static void main(String[] args) {char char1[]= {'t','e','s','t'};char char2[]={'t','e','s','t','1'};String s1=new String(char1);String s2=new String(char2,0,4);System.out.println(s1.equals(s2));}}

A. true
B. false
C. test
D. 编译错误

答案查题题库