| 
 
| 1DateFormat类中的parse()方法描述正确的是( ) ----- 单选 A、将毫秒值转成日期对象
 B、格式化日期对象
 C、将字符串转成日期对象
 D、将日期对象转成字符串
 
 2将十进制数100转成二进制数用哪个方法( ) ----- 单选
 A、toBinaryString()  值是String形式的.
 B、toHexString()
 C、intValue()
 D、toOctalString()
 
 3判断一个字符串是否包含另一个字符串的方法是( ) ----- 单选
 A、contains(String str)
 B、startsWith(String str)
 C、isEmpty()
 D、equals(Object obj)
 
 4下列关于Java API的说法错误的是( ) ----- 单选
 A、API即Application Programming Interface缩写
 B、API是一些接口
 C、Java API 提供了已经封装好的Java类
 D、Java API蕴含了面向对象封装思想
 
 5关于自动装箱,自动拆箱描述正确的是( ) ----- 单选
 A、自动装箱:把包装类类型转换为基本类型
 B、自动拆箱:把基本类型转换为包装类类型
 C、自动装箱:把基本类型转换为包装类类型
 D、以上都不对
 
 6下列程序的输出结果是( ) ----- 单选
 class Demo {
 publicstaticvoid main(String[] args) {
 String s1 = new String("abc");
 String s2 = "abc";
 System.out.println(s1 == s2);
 System.out.println(s1.equals(s2));
 }
 
 }
 A、true false
 B、false false
 C、true true
 D、false true
 
 7System.currentTimeMillis方法的作用是( ) ----- 单选
 A、返回值是int类型
 B、获取日期对象
 C、获取当前时间的毫秒值
 D、返回的是一个字符串
 
 8String类中int compareTo(String str)比较两个字符串的返回值一定是: (     )
 A、正数 负数 0
 B、1  -1  0
 C、1  -1
 D、1  -1  2
 
 9Math.floor(15.6)运行结果是( ) ----- 单选
 A、15.0
 B、15
 C、16.0
 D、16.6
 
 10按要求补全下列代码( ) ----- 单选
 统计大串中小串出现的次数
 public static void main(String[] args) {
 String max
 = "woaiheima,heimabutongyubaima,wulunheimahaishibaima,zhaodaogongzuojiushihaoma";
 String min = "heima";
 
 int count = 0;
 int index = 0;
 while((index = max.indexOf(____)) != -1) {
 count++;
 max = max.substring(_______);
 }
 }
 A、max0arr.length
 B、minindex
 C、maxindex + min.length()
 D、minindex + min.length()
 
 
 
 
 
 | 
 |