更多java基础知识试题
- 1给定以下程序段,如下:int i=0,j=-1;switch(i){case 0:j=1;case 2:j=2;default:j=5;}System.out.print("j="+j); 编译运行,正确的是
- 2提供Java存取数据库能力的包是?
- 3Java应用程序经过编译后会产生的字节码文件的扩展名是
- 4String a = "abcdefg"; String b = "abcdefg";System.out.println(a==b);运行后,该程序段的输出结果是
- 5以下输出是什么 ?class LowHighSwap{ static void doIt( int[] z ) { int temp = z[z.length-1]; z[z.length-1] = z[0]; z[0] = temp; }}class TestIt{ public static void main( String[] args ) { int[] myArray = {1, 2, 3, 4, 5}; LowHighSwap.doIt(myArray); for (int i = 0; i < myArray.length; i++) { System.out.print(myArray[i] + " "); } }}