ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

Java 错题整理 chapter 04

2021-11-26 16:31:28  阅读:289  来源: 互联网

标签:chapter What Java System 错题 println 单选题 Math out


4.

The statement System.out.printf("%3.1f", 1234.56) outputs ___________.

 回答错误

单选题 (1 分) 0 分

  1.  A.

    123.5

  2.  B.

    1234.56

  3.  C.

    123.4

  4.  D.

    1234.6

  5.  E.

    1234.5

注意四舍五入

6.

What is Math.round(3.6)?

单选题 (1 分) 1 分

  1.  A.

    3.0

  2.  B.

    3

  3.  C.

    4.0

  4.  D.

    4

四舍五入,注意

-1.5得到的是-1

-1.6得到-2

1.5得到2

1.4得到1

  1. 8.

    Math.floor(5.5) evaluates to _____.

     回答错误

    单选题 (1 分) 0 分

    1.  A.

      6.0

    2.  B.

      5.0

    3.  C.

      5

    4.  D.

      6

向下取整

5.5得到5.0

-5.5得到-6.0

12.

A Java character is stored in __________.

 回答错误

单选题 (1 分) 0 分

  1.  A.

    one byte

  2.  B.

    three bytes

  3.  C.

    four bytes

  4.  D.

    two bytes

20.

What is Math.rint(3.6)?

单选题 (1 分) 1 分

  1.  A.

    4.0

  2.  B.

    3

  3.  C.

    5.0

  4.  D.

    3.0

 

27.

Assume that the ASCII code for character c is 99. What is the printout of the following code?

System.out.println("a" + 'c');

 回答错误

单选题 (1 分) 0 分

  1.  A.

    196

  2.  B.

    9799

  3.  C.

    a99

  4.  D.

    ac

41.

Which of the following method returns the sine of 90 degree?

 回答错误

单选题 (1 分) 0 分

  1.  A.

    Math.sin(Math.PI)

  2.  B.

    Math.sin(Math.toRadian(90))

  3.  C.

    Math.sine(90)

  4.  D.

    Math.sin(90)

  5.  E.

    Math.sin(PI)

 

Java Math.toRadians() 方法用于将角度转换为弧度

50.

What is "Welcome" + 1 + 1*2?

 回答错误

单选题 (1 分) 0 分

  1.  A.

    Welcome11*2

  2.  B.

    Welcome3

  3.  C.

    Welcome12

  4.  D.

    Welcome4

54.

Suppose Character x = new Character('a'), __________________ returns true.

 回答错误

多选题 (3 分) 0 分

  1.  A.

    x.equals(new Character('a'))

  2.  B.

    x.compareToIgnoreCase('A')

  3.  C.

    x.equalsIgnoreCase('A')

  4.  D.

    x.equals('a')

  5.  E.

    x.equals("a")

58.

Which of the following are valid specifiers for the printf statement?

多选题 (3 分) 3 分

  1.  A.

    %6d

  2.  B.

    %10.2e

  3.  C.

    %8.2d

  4.  D.

    %10b

  5.  E.

    %4c

67.

Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i?

单选题 (1 分) 1 分

  1.  A.

    System.out.println((int)i);

  2.  B.

    System.out.println(i + " ");

  3.  C.

    System.out.println((char)i);

  4.  D.

    System.out.println(i);

标签:chapter,What,Java,System,错题,println,单选题,Math,out
来源: https://blog.csdn.net/qq_51415695/article/details/121558118

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有