- 浏览: 97270 次
文章分类
最新评论
-
luanloveni:
请问下共享session模式下,用户的不重复登录,先进先出,踢 ...
利用redis同步登陆实现session共享 -
aliucy:
属性重名是什么意思啊
No result defined for action com.daigou.controller.action.UserAction and result -
sgq0085:
Shiro有自己的ShiroSession 看我的帖子吧htt ...
利用redis同步登陆实现session共享 -
FeiXing2008:
shiro用web的session,然后在容器上配置Sessi ...
利用redis同步登陆实现session共享 -
qq466862016:
用到java了 又用到了spring 可以看下 spring- ...
利用redis同步登陆实现session共享
QUESTION 101
Given:
What creates the appropriate DateFormat object and adds a day to the Date object?
A. 35. Dateformat df = Dateformat.getDateFormat();
42. d.setTime ( (60 * 60 * 24) + d.getTime());
B. 35. Dateformat df = Dateformat.getDateInstance();
42. d.setTime ( (1000 * 60 * 60 * 24) + d.getTime());
C. 35. Dateformat df = Dateformat.getDateFormat();
42. d.setLocalTime ( (1000 * 60 * 60 * 24) + d.getLocalTime());
D. 35. Dateformat df = Dateformat.getDateInstance();
42. d.setLocalTime ( (60 * 60 * 24) + d.getLocalTime());
Answer: ( B )
转换成求加1天以后改日期的毫秒数,再调用setTime()设置时间。
QUESTION 102
Given:
Which two statements are true about the result if the locale is Locale.US? (Choose two.)
A. The value of b is 2.
B. The value of a is 3.14.
C. The value of b is 2.00.
D. The value of a is 3.141.
E. The value of a is 3.1415.
F. The value of a is 3.1416.
G. The value of b is 2.0000.
Answer: ( C, F )
使用NumberFormat类的getInstance()工厂方法会得到它的具体子类DecimalFormat的对象,默认情况下此DecimalFormat的相关属性如下:
² 使用当前默认语言环境的Locale;
² 最大小数位数maximumFractionDigits为3
² 最小小数位数minimumFractionDigits为0
² 最大整数位数maximumIntegerDigits为2147483647
² 最小整数位数minimumIntegerDigits为1
² 舍入模式是RoundingMode.HALF_EVEN
。RoundingMode.HALF_EVEN
是向最接近数字方向舍入的舍入模式,如果与两个相邻数字的距离相等,则向相邻的偶数舍入。例如:
u 示例:
² 输入数字 |
² 使用 HALF_EVEN 舍入模式 |
² 5.5 |
² 6 |
² 2.5 |
² 2 |
² 1.6 |
² 2 |
² 1.1 |
² 1 |
² 1.0 |
² 1 |
² -1.0 |
² -1 |
² -1.1 |
² -1 |
² -1.6 |
² -2 |
² -2.5 |
² -2 |
² -5.5 |
² -6 |
QUESTION 103
Place the correct description of the compiler output on the code fragment to be inserted at line 4 and 5. The same compiler output may be used more than once.
Answer: ( )
QUESTION 104
Given:
Which three will compile successfully? (Choose three.)
A. Object o = Old.get0(new LinkedList());
B. Object o = Old.get0(new LinkedList<?>());
C. String s = Old.get0(new LinkedList<String>());
D. Object o = Old.get0(new LinkedList<Object>());
E. String s = (String)Old.get0(new LinkedList<String>());
Answer: ( A, D, E )
B 错误 <?>不能用于实参传递,只能用于形参定义。
C 错误 get0()方法的回传值是Object, 因此不可赋值给String
此题的答案ADE选项的程式代码虽然能够编译通过,但是运行时会抛出java.lang.IndexOutOfBoundsException异常。
QUESTION 105
Exhibit:
Which statement is true about the set variable on line 12?
A. The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.
B. The set variable contains only three elements from the coll collection, and the order is guaranteed to be preserved.
C. The set variable contains all six elements from the coll collection, but the order is NOT guaranteed to be preserved.
D. The set variable contains only three elements from the coll collection, but the order is NOT guaranteed to be preserved.
Answer: ( D )
枚举类型的hashCode()方法和equals()方法实现如下:
/**
* Returns true if the specified object is equal to this
* enum constant.
*
* @param other the object to be compared for equality with this object.
* @return true if the specified object is equal to this
* enum constant.
*/
public final boolean equals(Object other) {
return this==other;
}
/**
* Returns a hash code for this enum constant.
*
* @return a hash code for this enum constant.
*/
public final int hashCode() {
return super.hashCode();
}
super指的就是Object类,调用Object类提供的hashCode方法来直接返回该对象的内存地址值。
Set中不能存放重复的元素(使用hashCode方法和equals方法双重判断),但是不保证所存放元素的顺序
发表评论
-
SCJP真题汇总第二卷下载
2012-11-15 08:07 765面所有SCJP的真题,现在给大家提供下载,包括以前发布真题时所 ... -
SCJP真题汇总第一卷下载
2012-08-20 09:54 981整理前面所有SCJP的真题,现在给大家提供下载,包括以前发布真 ... -
SCJP真题22
2012-07-18 11:04 1004QUESTION 106 Given: What ... -
SCJP真题库更新20
2012-06-30 07:43 868QUESTION 96 Given: What is ... -
SCJP真题库更新19
2012-06-29 07:52 974QUESTION 91 Given a method tha ... -
SCJP真题库更新18
2012-06-16 09:02 863QUESTION 86 Given: What ... -
SCJP真题库更新17
2012-06-15 11:32 956QUESTION 81 Given: and t ... -
SCJP真题库更新16
2012-06-14 08:37 963QUESTION 76 A class games.card ... -
SCJP真题库更新15
2012-06-13 09:45 950QUESTION 71 Given: A progr ... -
SCJP真题库更新14
2012-06-12 08:23 982QUESTION 66 Given a pre-gen ... -
SCJP真题库更新13
2012-06-11 08:13 872QUESTION 61 GIVEN THE EXHIBIT ... -
SCJP真题库更新12
2012-06-09 09:07 951QUESTION 51 Given the exhibit: ... -
SCJP真题库更新11
2012-06-08 07:55 882QUESTION 46 1.public class ... -
SCJP真题库更新10
2012-06-07 08:42 921QUESTION 41 Given the exhibit: ... -
SCJP真题库更新9
2012-06-06 09:02 853QUESTION 36 Given the exhibit: ... -
SCJP真题库更新8
2012-06-05 08:46 1063QUESTION 31 Exhibit: What i ... -
SCJP真题库更新7
2012-06-04 10:06 843QUESTION 25 Exhibit: What ... -
SCJP真题库更新6
2012-06-02 09:04 1048QUESTION 18 Exhibit: Wha ... -
SCJP真题库更新5
2012-06-01 10:27 876QUESTION 14 Given the exhibit: ... -
SCJP真题库更新4
2012-06-01 10:25 746QUESTION 10 Given the exhibit: ...
相关推荐
scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库
scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库 java题库java题库java题库java题库java题库java题库
sun公司scjp认证题库 短小精悍,覆盖面强,摒弃题海,专注重要的知识点
最新题库,含200多道真题,做完这个题库的题,过scjp基本没问题
scjp题库(收集了CSDN上大部分题库,近1000道SCJP试题 看看大小就知道了,.jar文件直接双击打开
java scjp认证考试题库 都有答案 慢慢我会把注释也加上的
SCJP轻松过 SCJP学习指南 SCJP试题 scjp题库
背下来就好了,哈哈SCJP题库,有了它必过SCJP题库,有了它必过SCJP题库,有了它必过SCJP题库,有了它必过
SCJP最新题库,正式考试时很多题都是原题,不是原题的很多题也类似,如果你搞懂了这里的所有题,你肯定能过,我考了95%
scjp
内含多套试题、scjp测试模拟器等 内含多套试题、scjp测试模拟器等
当时参加scjp考前培训时,老师给我们的题库。考试时的题目上面基本都有,做一遍考试过绝对没问题。
2010年SCJP标准题库-jdk1.5
通过SCJP的捷径~我考了70分!想要考或者准备考SCJP的朋友来看看吧!有答案!
java题库+scjp模拟题。希望对你有帮助
这是最新的SCJP考试题库,有答案,把这过一遍,考试肯定过!
ocjp认证。适合有一定java基础的人看。里面的题比较偏重底层
2013 年 最新SCJP 考试题库。全英文题目