首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java面试 >

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

2012-03-07 
下面这道题目Consider the following Java program segment.import java.io.*public class SomeClass{pub

下面这道题目

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

热点排行