注意:此页面搜索的是所有试题
湖南大学-网络编程
Java的源代码中定义几个类,编译结果就生成几个以.class为后缀的字节码文件。
jsp:forward是一种客户端跳转.
JSP页面文件实际上会先被转化成java源文件,然后再进行编译.
在异常处理中,若try中的代码可能产生多种异常则可以对应多个catch语句,若catch中的参数类型有父类子类关系,此时应该将父类放在后面,子类放在前面。
Java有垃圾回收机制,内存回收程序可在指定的时间释放内存对象。
.BufferedReader是一种处理流,也是一种字节流,也是一种输入流.
类Parent、Child定义如下: 1. public class Parent 2.{ public float aFun(float a, float b) throws 3. IOException { } 4.} 5.public class Child extends Parent{ 6. 7.} 将以下哪种方法插入行6是不合法的。( A ) A、float aFun(float a, float b){ } B、public int aFun(int a, int b)throws Exception{ } C、public float aFun(float p, float q){ } D、public int aFun(int a, int b)throws IOException{ }
编译并运行以下程序,以下描述哪个选项是正确的( C ) 1. class X{ 2. protected String toString(){ 3. return super.toString();} 4. } A、编译通过运行无异常 B、编译通过但运行时出错 C、行2出错,不能成功编译 D、不能成功编译,行3出错
关于以下代码段的说法正确的是( D ) 1.String s="abcde"; 2.StringBuffer s1=new StringBuffer("abcde"); 3.if(s.equals(s1)) 4. s1=null; 5.if(s1.equals(s)) 6. s=null; A、第1行编译错误,String的构造器必须明确调用 B、第3行编译错误,因为s与s1有不同的类型 C、编译成功,但执行时在第5行有异常抛出 D、编译成功,过程中也没有异常抛出
某web应用的上下文路径是root,配置文件web.xml中有如下片段: <servlet> <servlet-name>process</servlet-name> <servlet-class>slt.ProcessServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>process</servlet-name> <url-pattern>/proc</url-pattern> </servlet-mapping> 以下说法正确的是(B)。 a)以下说法都不正确 b)该servlet的访问路径是http://机器IP:端口号/root/proc c)该servlet的访问路径是http://机器IP:端口号/root/ProcessServlet d)该servlet的访问路径是http://机器IP:端口号/root/ProcessServlet 5. J2EE中,(A)类()方法用于返回应用程序的上下文路径。
J2EE中,(A)类()方法用于返回应用程序的上下文路径。 a) HttpServletRequest、getContextPath() b) HttpServletRequset、getPathInfo() c) ServletContext、getContextPath() d) ServletContext、getPathInfo()
Java application中的主类需包含main方法,main方法的返回类型是什么?( D ) A、int B、float C、double D、void
设有下面两个类的定义: class Person { class Student extends Person { long id; // 身份证号 int score; // 入学总分 String name; // 姓名 int getScore(){ } return score; } } 则类Person和类Student的关系是( B )。 A、包含关系 B、继承关系 C、关联关系 D、上述类定义有语法错误
在Servlet里,能正确获取session的语句是(A)。 a) HttpSession session = request.getSession(true); b) HttpSession session = request.getHttpSession(true); c) HttpSession session = response.getSession(true); d) HttpSession session = response. getHttpSession (true);
下面哪个函数是public void aMethod(){...}的重载函数?( D ) A、void aMethod( ){...} B、public int aMethod(){...} C、public void aMethod ( ){...} D、public int aMethod ( int m){...}
jsp:forward是一种客户端跳转.
JSP页面文件实际上会先被转化成java源文件,然后再进行编译.
在异常处理中,若try中的代码可能产生多种异常则可以对应多个catch语句,若catch中的参数类型有父类子类关系,此时应该将父类放在后面,子类放在前面。
Java有垃圾回收机制,内存回收程序可在指定的时间释放内存对象。
.BufferedReader是一种处理流,也是一种字节流,也是一种输入流.
类Parent、Child定义如下: 1. public class Parent 2.{ public float aFun(float a, float b) throws 3. IOException { } 4.} 5.public class Child extends Parent{ 6. 7.} 将以下哪种方法插入行6是不合法的。( A ) A、float aFun(float a, float b){ } B、public int aFun(int a, int b)throws Exception{ } C、public float aFun(float p, float q){ } D、public int aFun(int a, int b)throws IOException{ }
编译并运行以下程序,以下描述哪个选项是正确的( C ) 1. class X{ 2. protected String toString(){ 3. return super.toString();} 4. } A、编译通过运行无异常 B、编译通过但运行时出错 C、行2出错,不能成功编译 D、不能成功编译,行3出错
关于以下代码段的说法正确的是( D ) 1.String s="abcde"; 2.StringBuffer s1=new StringBuffer("abcde"); 3.if(s.equals(s1)) 4. s1=null; 5.if(s1.equals(s)) 6. s=null; A、第1行编译错误,String的构造器必须明确调用 B、第3行编译错误,因为s与s1有不同的类型 C、编译成功,但执行时在第5行有异常抛出 D、编译成功,过程中也没有异常抛出
某web应用的上下文路径是root,配置文件web.xml中有如下片段: <servlet> <servlet-name>process</servlet-name> <servlet-class>slt.ProcessServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>process</servlet-name> <url-pattern>/proc</url-pattern> </servlet-mapping> 以下说法正确的是(B)。 a)以下说法都不正确 b)该servlet的访问路径是http://机器IP:端口号/root/proc c)该servlet的访问路径是http://机器IP:端口号/root/ProcessServlet d)该servlet的访问路径是http://机器IP:端口号/root/ProcessServlet 5. J2EE中,(A)类()方法用于返回应用程序的上下文路径。
J2EE中,(A)类()方法用于返回应用程序的上下文路径。 a) HttpServletRequest、getContextPath() b) HttpServletRequset、getPathInfo() c) ServletContext、getContextPath() d) ServletContext、getPathInfo()
Java application中的主类需包含main方法,main方法的返回类型是什么?( D ) A、int B、float C、double D、void
设有下面两个类的定义: class Person { class Student extends Person { long id; // 身份证号 int score; // 入学总分 String name; // 姓名 int getScore(){ } return score; } } 则类Person和类Student的关系是( B )。 A、包含关系 B、继承关系 C、关联关系 D、上述类定义有语法错误
在Servlet里,能正确获取session的语句是(A)。 a) HttpSession session = request.getSession(true); b) HttpSession session = request.getHttpSession(true); c) HttpSession session = response.getSession(true); d) HttpSession session = response. getHttpSession (true);
下面哪个函数是public void aMethod(){...}的重载函数?( D ) A、void aMethod( ){...} B、public int aMethod(){...} C、public void aMethod ( ){...} D、public int aMethod ( int m){...}