题目内容

Which of the following is incorrect?

A. double x = 1.0;
B. float x = 1.0;
C. long x = 9;
D. int x = 9;

查看答案
更多问题

Which of the following assignment statements is illegal?

A. int t = 23;
B. short s = 10;
C. float f = -34;
D. float f = 34.0;

Analyzethefollowingcode.publicclassTest{publicstaticvoidmain(String[]args){intmonth=09;System.out.println("monthis"+month);}}

A. Theprogramdisplaysmonthis9.
B. Theprogramdisplaysmonthis09.
C. Theprogramhasasyntaxerror,because09isanincorrectliteralvalue.
D. Theprogramdisplaysmonthis9.0.

Analyzethefollowingcode:publicclassTest{publicstaticvoidmain(String[]args){intn=10000*10000*10000;System.out.println("nis"+n);}}

A. Theresultof10000*10000*10000istoolargetobestoredinanintvariablen.Thiscausesanoverflowandtheprogramisaborted.
B. Theresultof10000*10000*10000istoolargetobestoredinanintvariablen.ThiscausesanoverflowandtheprogramcontinuestoexecutebecauseJavadoesnotreporterrorsonoverflow.
C. Theprogramdisplaysnis1000000000000.
D. Theresultof10000*10000*10000istoolargetobestoredinanintvariablen.ThiscausesanunderflowandtheprogramcontinuestoexecutebecauseJavadoesnotreporterrorsonunderflow.

规则标识符严格遵守标识符命名规则是()

A. 由字母、数字、下划线、@、
B. 和$符号组成
C. 首字母不能为数字和$符号
D. 标识符不允许是保留字,标识符内不能出现空格和特殊字符,长度小于128个字符
E. 以上都是

答案查题题库