读书人

下面这道题目,该如何处理

发布时间: 2012-03-07 09:13:51 作者: rapoo

下面这道题目

Consider the following Java program segment.

import java.io.*;

public class SomeClass{

public void x() {

throw new RuntimeException("Exception from x");
}

public void y(){

throw new IOException("Exception from y");
}
}
Which of the following is true concerning the definitions for the methods x and y?



(a) x has an illegal definition, but y has a legal definition.
(b) x has a legal definition, but y has an illegal definition.
(c) Both x and y have legal definitions.
(d) Neither x nor y has a legal definition.


[解决办法]
我选B

读书人网 >Java面试

热点推荐