throw new IOException("Exception from y"); } } Which of the following is true concerning the definitions for the methods x and y?
(a) Neither x nor y has a legal definition. (b) Both x and y have legal definitions. (c) x has an illegal definition, but y has a legal definition. (d) x has a legal definition, but y has an illegal definition.
²»»á×ö¡¡´óÏÀ°ïæ~£¡Ð»Ð»~£¡ ÎÒÖ»ÖªµÀ public void y(){
throw new IOException("Exception from y"); } ÕâÊÇ´íµÄ ÎÒ²»ÖªµÀÑóÎÄ àÅàÅ£¬´ð°¸ÊÇxÊǺϷ¨µÄ£¬yÊDz»ºÏ·¨µÄ£¬ÎªÊ²Ã´Ñ½£¿ Ñ¡D£¬RuntimeException²»ÐèÒªÒì³£ÉùÃ÷£¬IOExceptionÐèÒª ËùÒÔyÓ¦¸ÃÉùÃ÷Ϊpublic void y() throws IOException ÎÒÑ¡C£¬²»Öª¶Ô´í£¬Çë¸ßÊÖÖ¸µã£¡ ´ð°¸ÊÇD£¬ÒòΪxÅ×µÄÊÇruntimeµÄexception£¬¸ÄÒì³£²»catchÒ²ÊÇ¿ÉÒÔµÎ