当前位置:首页 > 《使用java实现面向对象编程》题库 - 图文
2 三个 D、四个 System类中哪方法是对数据进行拷贝的( A) A arraycopy B copy C setArrayCopy D setArray ▲ 二 类 ▲ ▲ 10.1.1System▲类 ▲ (不常 考) 10.1.1System类 3 4 5 6 7 以下对System类中exit方法描述正确的是 ( A) A 终止程序 B 只能正常终止程序 C 只能异常终止程序 D 以上都不正确 在System中能够获取系统信息的方法是(A ) A getProperty B setProperty C getPropertys D setPropertys System类中哪个方法可以获取系统时间的毫秒数( D ) A getTime() B getCurrentTimeMillis() C time() D currentTmeMillis() 以下那个选项是所有类的父类( A) A、Object B、Class C、System D、以上都不正确 以下哪个是Object类的方法( A ) A、 getClass B、getName C、setClass D、setName 以下哪个选项可以获取类的基本信息( A ) A getClass B wait C notify D 以上都不正确 以下哪个选项可以唤醒等待( C ) A getClass B wait C notify 二六 ▲▲ 二六 ▲▲ 10.1.1System类 二 ▲▲ 10.1.1System类 二 ▲ 10.2.1 Object类 二 ▲▲ 10.2.110.2.110.2.1 Object类 8 二 ▲▲ 10.2.1 Object类 9 二 ▲▲ 10.2.1 Object类 10 11 12 13 14 15 16 17 D 以上都不正确 已知int i=123,通过以下哪种方式可以得到字符串二 \。 A.Integer.parseInt(i); B.String.valueOf(i); C.Long.parseLong(i); D.Float.parseFloat(i); 通过Math类获得一个随机值,下面语句正确的是(C) 二 A、Math m=new Math(); int i=m.random(); B、int i=Math.random(); C、double d=Math.random(); D、 Math m=new Math(); double d =m.random(); 二 Math.rint(5.4)该方法执行的结果是(A) A、5.0 B、5 C、6.0 D 6 二 Math.round(5.4)该方法执行的结果是(B) A、5.0 B、5 C、6.0 D 6 二 Math.max(6.0, 6)该方法执行的结果是(C) A、false B、true C、6.0 D 6 通过Random类产生一个0-25之间的随机数,则正确二 的是(D) A.int i=Random.nextInt(); B.int i=Random.nextInt(25); C.Random r=new Random(); int i=r.nextInt(); D.Random r=new Random(); int i=r.nextInt(25); SimpleDateFormat可以用来将Date对象格式化成各二 种字符串,能够将日期Date d转换为“2012-08-01”格式的语句是( A ) A.SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd”); sdf.format(d); B.SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd”); sdf.parse(d); C.SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-mm-dd”); sdf.parse(d); D.SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-mm-dd”); sdf. format (d) 二 获取当前系统时间,下列写法正确的是(BC) A,Date d = new Date(1911,3,4); ▲▲ 10.2.2 包装类 ▲▲ 10.2.3 Math类 ▲▲ ▲▲ ▲▲ ▲▲ 10.2.3 Math类 10.2.3 Math类 10.2.3 Math类 10.2.3 Math类 ▲▲ 10.3.3 SimpleDateFormat类 ▲▲ 10.3 处理日期的类 18 19 20 21 22 23 24 25 26 B,Date d = new Date(); C, Canlender c = Canlender. getInstance(); D, Canlender c = new Canlender (); 下列方法中属于SimpleDateFormat中字符串和Date之间类型转换的方法(BD) A,get B, format C, change D,parse 能够正确创建Date对象的方法是( AB ) A、new Date() B、new Date(1234567) C、getDate() D、getDay() 下列哪个选项可以获取一个时间的毫秒数( A ) A、getTime() B、getDate C、getDay D、getLong 下列哪个选项可以获取一个月的某一天( B) A、getTime() B、getDate C、getDay D、getLong 下列哪个选项可以获取某一周的星期几( C ) A、getTime() B、getDate C、getDay D、getLong 下面那个不正确(A) A、Now.get(Calendar.Month);这样的方法 1表示一月,2表示二月 B、get(Calendar.DAY_OF_MONTH)获得这个月的第几天 C、get(Calendar.DAY_OF_WEEK)获得这个星期的第几天 D、get(Calendar.DAY_OF_YEAR)获得这个年的第几天 Calendar类中哪个属性用来表示年( A ) A YEAR B getYEAR C year D getYear Calendar类中哪个方法用来获取日历信息( A ) A get(int i) B getDay C getInstance() D getYear Calendar类中哪个属性用来获取一年中的某一天二 ▲▲ ▲▲ 10.3.3 SimpleDateFormat类 三 10.3 处理日期的类 三 ▲▲ 10.3.1 Date类 10.3.2 Calendar类 10.3.1 Date类 三 ▲▲ 二 ▲▲ 10.3 处理日期的类 二 ▲▲ 10.3 处理日期的类 二 ▲▲ 10.3 处理日期的类 二 ▲▲ 10.3 处理日期的类 二 ▲10.3.227 28 29 30 31 32 33 34 35 36 ( A ) A DAY_OF_YEAR B DAY_OF_WEEK C DAY_OF_MONTH D 以上都不正确 二 以下那个是System的属性( A D) A、 in B、size C、length D、out 二 以下哪些是System类中的属性( ABC ) A err B in C out D show 下面表达式计算的结果和返回值类型分别是?(B二 的) Math.ceil(0.1 + Math.floor(Math.random())); 0-1之间的小数 A.0.0 B.1.0 C.float D.double E.一个随机数 二 以下描述正确的是 ( A B ) A、max(int a,int b)比较两个数的大小并返回 较大的数值 B、min(int a,int b)比较两个数的大小并返回 较小的数值 C、random() 返回一个随机的正整数 D、abs() 四舍五入一个数 三 下列属于Math类的方法的是( ABD )。 A.random() B.abs() C.readLine() D.sin() 三 System类在哪个包中( java.lang ) System类中_____in_____为标准输入 System类中_____out_____为标准输出 System类中_____err_____为标准错误输出 System类中_____exit()_____方法可以终止程序 三 三 三 三 ▲ Calendar类 ▲▲ 10.1.1 System类 ▲▲ 10.1.1 System类 ▲▲ 10.2.3 Math类 ▲▲ 10.2.3 Math类 ▲▲ ▲▲ ▲▲ ▲▲ ▲▲ ▲10.2.3 Math类 10.1.1 System类 10.1.1 System类 10.1.1 System类 10.1.1 System类 10.1.1
共分享92篇相关文档