• 2022-06-16
    下列( )选项不是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
  • B

    举一反三

    内容

    • 0

      请说出下列程序的输出结果_____________,_____________。import java.io.IOException;public class E {public static void main(String args[]){try { methodA();}catch(IOException e){System.out.print("你好");return;}finally {System.out.println("thanks");}}public static void methodA() throws IOException{throw new IOException();}}

    • 1

      给定如下所示的Java Servlet代码片段,用户在浏览器地址栏中键入正确的请求URL并回车后,在控制台上显示的结果是()。 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ System.out.println(“get”); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ System.out.println(“post”); } protected void service(HttpServletRequest req, HttpSergvletResponse resp) throws ServletException, IOException{ System.out.println(“service”); }

    • 2

      中国大学MOOC: 若testFails()方法返回true,选项( )是下列代码的执行结果public void method() throws IOException{ If(testFails()){ throw new IOExcetpion(); }}

    • 3

      类Test1、Test2定义如下: A: public  class  Test1 B: { public  float  aMethod(float a,float b) throws C: IOException {      } D: } E: public  class  Test2  extends  Test1{ F: G: } 将以下哪种方法插入行6是不合法的。 H: float  aMethod(float  a,float  b){ } I: public  int  aMethod(int a,int b)throws  Exception{ } J: public  float  aMethod(float  p,float q){ } K: 都不对

    • 4

      中国大学MOOC: 给定某Servlet程序的片段如下,用户在浏览器地址栏中键盘键入正确的请求URL并回车后,在控制台上显示的结果是( )。 public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException ,IOException{ System.out.println(get); } public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException ,IOException { System.out.println(post); }