下列( )选项不是InputStream类中的方法。
A: public abstract int read( ) throws IOException
B: public final void writeInt (int throws IOException
C: public void close( )throws IOException
D: public int available( )throws IOException
A: public abstract int read( ) throws IOException
B: public final void writeInt (int throws IOException
C: public void close( )throws IOException
D: public int available( )throws IOException
举一反三
- 下列方法声明部分正确的有哪些? A: public void method() throws Exception B: public void method() throw Exception C: public void method() throws IOException D: public void method() throws RuntimeException
- methodName()方法将抛出IOException异常,方法正确定义的形式是() A: public<br/>IOException methodName() B: public<br/>void methodName() throw new IOException C: public<br/>void methodName() throw IOException D: public<br/>void methodName() throws IOException
- 给出下列程序的输出结果。import java.io.IOException;public class E {public static void main(String args[]){int m =10;try {methodA();m = 100;}catch(IOException e){m = 1000;}System.out.println(m);}public static void methodA() throws IOException{throw new IOException();}}
- LoginServlet是一个Servlet类,代码如下 public class LoginServlet extends ___________ { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { … } public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { … } } 在下划线处应填写()
- 有如下代码段:1) A: { if(unsafe()){//do something…} B: else if(safe()){//do the other…} C: } 其中,方法unsafe() 将抛出IOException, 请问可将以下哪项填入第1行。 D: public IOException methodName() E: public void methodName() F: public void methodName() throw IOException G: public void methodName() throws IOException