1 C
假设在helloapp应用中有一个hello.jsp,它的文件路径如下:%CATALINA_HOME%/webapps/helloapp/hello/hello.jsp,那么在浏览器端访问hello.jsp的URL是什么?
A、http://localhost:8080/hello.jsp
B、http://localhost:8080/helloapp/hello.jsp
C、http://localhost:8080/helloapp/hello/hello.jsp
2
关于JAVA垃圾回收说法错误的是:
A、程序员无法强制调用垃圾回收器明确的回收制定对象。
B、程序员无法强制运行垃圾回收器。
C、有了垃圾回收器不会出现内存泄漏问题。
D、不同的Java虚拟机实现具有不同的垃圾回收机制,即不同的垃圾回收算法。
3 当需使用一个结构存储不重复的元素,不需要对存储的元素进行排序,以下哪个接口
是正确的的
A、set B、list C、map D、vector
4 下列哪个方法不是Inputstream的方法:
A、int read() B、reset() C、flush() D、mark()
5 下面关于提交方式选项正确的是
<form action=”abc.servlet”>
<input type=”text” name=”userName”/>
<input type=”submit” value=”提交”/>
</form>
A post提交 B get提交 C 不能正确提交 D post和get混合提交
6 JDBC中,Statement的executeUpdate(String arg)方法返回一个int值。 这个返回值代表的含义是什么?
A成功或失败 B执行SQL影响的条数 C一个固定值为0 D一个固定值为1
7 E
假设在helloapp应用中有一个HelloServlet类,它在web.xml文件中的配置如下:
<servlet>
<servlet-name> HelloServlet </servlet-name>
<servlet-class>com.xdfyb.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> HelloServlet </servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
那么在浏览器端访问HelloServlet的URL是什么? (单选)
选项:
(A) http://localhost:8080/HelloServlet
(B) http://localhost:8080/helloapp/HelloServlet
(C) http://localhost:8080/helloapp/com/xdfyb/hello
(D) http://localhost:8080/helloapp/com/xdfyb/HelloServlet
(E) http://localhost:8080/helloapp/hello
8 JAVA SERVLET API中forward() 与redirect()的区别
A forward 是二次请求
B redirect是一次请求
C redirect 是重定向,二次请求
D 没有区别
9 关于SERVLET 中 doGet()和doPost() 下面说法正确的是
A 没有区别都可以处理用户的请求
B 当请求的时候先调用doPost再调用doGet
C 当请求的时候先调用doGet再调用doPost
D 根据用户的请求类型 分别调用、
10 下列数组初始化正确的是
A int[5] a= {1,2,3,4,5};
B int[2][2] a = {{1,2},{3,4}};
C int[][] a = {{2,3,4,5},new int[3]};
D int[][] a = new int[][5];