题目内容

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. 以上都是

关于浮点型数据Decimal(p,s)的不正确说法()

A. P为有效位数,其值等于整数位数和小数位数之和
B. P为有效位数,S为小数位数
C. P为整数部分位数,S为小数位数
D. S为小数位数,默认为0

答案查题题库