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

下面这道题目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