请教各位几道JAVA试题!希望大家帮忙!
1、Refer的类层次结构,如下图所示。
动物
狗 猫 .....
Consider the following code:
1. Dog rover, fido;
2. Animal anim;
4. rover = new Dog();
5. anim = rover;
6. fido = (Dog)anim;
Which of the following statements is true? (Choose one.) My answer is D
A. Line 5 will not compile.
B. Line 6 will not compile.
C. The code will compile but will throw an exception at line 6.
D. The code will compile and run.
E. The code will compile and run, but the cast in line 6 is not required and can be eliminated.
2、请说出如下几个类的特性 并说明Collection 和 Collections的区别?
a) java.util.ArrayList
b) java.util.HashSet
c) java.util.TreeSet
d) java.util.HashMap HashMap和Hashtable的区别
3、一个JSP页面传递了一个request对象名字"test" 该页面使用标签
<bean:write name="test" property="info.value">
请说明显示的内容来自于哪里?
My answer :Test 对象内关联的 info对象的 value值
4、编写程序 带2个输入参数 起始值 最大值
比如 输出1-100的质数 (质数:只能被自己和1整除的自然数)
1.编译后能够正常运行
相关问答:
我的开发的平台是Myeclipes6.0 + tomcat5.x + mysql
我所有的编码方式都是用的UTF-8
我只用了Strtus框架
在一个form中如下用的是post的提交方式:
<form class="form" action=&quo ......
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
public class Student{
//字段的定义
private String _number; //学号
private String _name; //姓名
private   ......