多选题
Consider the following illustration. Which statements, also represented in the illustration, are true?
A
B
C
D
【正确答案】
B、C、D
【答案解析】
因为它们都表示正确的语句。B正确,因为String类实现了Comparable、Serializable和CharSequence接口。C正确,因为toString方法重写了Object类的toString方法,允许String对象返回自己的字符串。D正确,因为toString方法也可以公开访问。A不正确。Object类不是具体的类。因此,String类不能实现Object接口,因为没有Object这样的接口。String类实际上扩展了Object的一个具体类。
提交答案
关闭