System.out.println("1 big bad wolf\t8 the 3 little pigs\n4 dinner\r2night");
答案:2。\r是回车,回到当前行行首。html
A . Every variable must have an associated type before you can use it (在使用变量以前,每一个变量必定都有一个与之关联的类型)
B . Variables can be used without declaring their type (变量能够在不声明其类型的状况下使用)
C . Every variable has a single type associated with it throughout its existence in the program, and the variable can only store values of that type (在程序中,每一个变量都有一个与之关联的类型,而变量只能存储该类型的值)
D . Variables are allowed to change type during their existence in the program as long as the value it currently stores is of the type it is currently declared to be (变量存在于程序中时容许改变类型,只要它当前存储的值是当前声明的类型)
E . Variables are allowed to change types during their existence in the program but only if the change is to a narrower type (变量存在于程序中时容许改变类型,但只能缩窄转换)
答案:C。定义变量时必须声明类型。java
A . if (x > 0) x++;git
else x--;
B . if (x > 0) x++;vim
else if (x < 0) x--;
C . if (x > 0) x++;数据结构
if (x < 0) x--;app
else x = 0;
D . if (x == 0) x = 0;dom
else x++;ide
x--;函数
答案:B。题目说的若是是0就不操做,而C作了操做。学习
A . A syntax error may be generated by the compiler
B . A runtime error may occur during execution
C . A "garbage" or "uninitialized" value will be used in the computation
D . A value of zero is used if a variable has not been initialized
E . Answers A and B are correct
答案:E。按照题目的意思,出现编译错误也能够运行。
Random gen = new Random( );
A . gen.nextFloat( ) * 5
B . gen.nextFloat( ) * 10 - 5
C . gen.nextFloat( ) * 5 - 10
D . gen.nextInt( ) * 10 - 5
E . gen.nextInt(10) - 5
答案:B。看错。
A . compares two string in a case-independent manner
B . yields true or false
C . yields 0 if the two strings are identical
D . returns 1 if the first string comes lexically before the second string
E . none of the above
答案:C。没看懂identical的意思。
a) String string = new String("123.45");
b) String string = "" + 123.45;
A . true
B . false
答案:A。能够用双引号提示程序是一个字符串,而后用加号对字符串链接。
A . true
B . false
答案:B。声明范围太广了,只能声明倒数第二级的。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 10000行 | 30篇 | 400小时 | |
第一周 | 138/138 | 2/2 | 25/25 | 学会写和上传代码,会编简单的输出程序 |
第二周 | 118/256 | 1/3 | 30/55 | 起文件名不能太长 |
第三周 | 868/1124 | 2/5 | 35/90 | Java类里面的方法和C语言的函数很像 |