• 测试信息
测试学科: JAVA基础
测试人数: (765)
正确率: 56.82%
发布于:
测试描述: Java工程师面试基础必备知识测试
1. 下面哪个赋值语句是不合法的?
float a = 2.0
double b = 2.0
int c = 2
long d = 2
2. 下面哪个是main()函数的合法参数?
char args[]
char args[][]
String args[]
String args
3. 下面哪个语句不是创建数组的正确语句?
float f[][] = new float[6][6];
float []f[] = new float[6][6];
float f[][] = new float[][6];
float [][]f = new float[6][];
4. 已知表达式int m[] = {0, 1, 2, 3, 4, 5, 6 }; 下面哪个表达式的值与数组下标量总数相等?
m.length()
m.length
m.length()+1
m.length+1
5. 已知如下的命令执行 java MyTest a b c 请问哪个语句是正确的?
args[0] = "MyTest a b c"
args[0] = "MyTest"
args[0] = "a"
args[1]= ´c´
6. 已知如下代码: public class Test { long a[] = new long[10]; public static void main ( String arg[] ) { System.out.println ( a[6] ); } } 请问哪个语句是正确的?
Output is null.
Output is 0.
When compile, some error will occur.
When running, some error will occur.
7. 已知如下代码: boolean m = true; if ( m == false ) System.out.println("False"); else System.out.println("True"); 执行结果是什么?
False
True
None
An error will occur when running.
8. 已知如下代码: public class Test { public static void main(String arg[]) { int i = 5; do { System.out.print(i); } while (--i>5); System.out.println("Finished"); } } 执行后的输出是什么?
5Finished
4Finished
6Finished
None
9. 下面代码执行后的输出是什么? outer: for(int i=0;i<3; i++) inner: for(int j=0;j<2;j++) { if(j==1) continue outer; System.out.print(j+ " and "+i); }
0 and 00 and 10 and 2
0 and 00 and 20 and 1
0 and 10 and 00 and 2
0 and 10 and 20 and 1
分享
  • 发布人
昨日东流水
上海 杨浦区
下载手机APP,做题更方便!