- 1、本文档共24页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
容易错的单选题集
容易错的单选题集
1.如果要实现Hibernate删除一个对象时,同时级联删除与其相关联的其他对象,cascade属性的值一个设置为(delete)。
2.下列语句片段的结果为()。
int a=-67,b=116,c=78;
int d=~a|bc;
System.out.println(d);
-67取反 | 116
78
703.已经声明了类“public class Th implements Runnable”,下面哪个选项启动该线程(Thread t=new Thread(new Th()); t.start();)。
4.以下哪项可用于检索session属性userid的值(session. getAttribute (“userid”);)。
5.有代码如下,如需补全选择()。
public class Example{
public enum Color{Red,Green,Blue};
public void foo(){
//在这里插入代码
System.out.println(c);
}
}
for(Color c:Color.values())
6.在JSP中,使用()接收客户端发送的请求数据。
request.getParameter();
7. class A {
public static int getNumber(int a) {
return a + 1;
}
}
public class B extends A {
public static int getNumber(int a) {
return a + 2;
}
public static void main(String[] args) {
B b = new B();
System.out.println(getNumber(0));
}
}
上面代码的结果是什么?
第12行出现编译错误 不知道是哪个方法。多态
8.int index=1;
String[] test=new String[3];
String foo=test[index];
foo的值是多少(B)。
9.从HTTP请求中,获得请求参数,应该调用(request对象的getParameter()方法 )。
10.哪个关键字可以对对象加互斥锁(synchronized)。
11.哪个可以得到file.txt的父目录的名字(String name=(new File(file.txt)).getParent();
)。
12.如果要创建用于上传文件的表单,html:form标签的编码类型“method”属性必须设置为(POST )。
13.Java程序经编译后会产生byte code
14.有关JSP中getProperty与setProperty标准动作的使用,下列说法中正确的是(必须在使用useBean的前提下,才能使用)。
15.在J2EE三层体系结构中,中间层与MVC设计模式中的(控制器)模块相对应。
16.public class SychTest{
private int x;
private int y;
public void setX(int i){ x=i;}
public void setY(int i){y=i;}
public synchronized void setXY(int i){
setX(i);
setY(i);
}
public synchronized boolean check(){
return x!=y;
}
}
在什么条件下,在其它类中调用check()返回true(当多个线程分别调用setX和setY时check() 返回true
)。
17.数组没有length()这个方法,string有length()这个方法。
18.关于以下application的说明,正确的是
1. class StaticStuff
2. {
3. static int x=10;
4. static { x+=5;}
5.
文档评论(0)