更多java基础知识试题
- 1要从文件“file.dat”文件中读出第10个字节到变量c中,下列哪个方法适合( )。
- 2下述代码的执行结果是class Super { public int getLength() { return 4; }}public class Sub extends Super { public long getLength() { return 5; } public static void main (String[]args) { Super sooper = new Super (); Super sub = new Sub(); System.out.printIn(sooper.getLength()+ “,” + sub.getLength() ); }}
- 3变量命名规范说法正确的是( )
- 4以下程序段的输出是什么 ?int[] num7 = {1, 3, 5, 2, 8, 9, 5, 0};int x7 = num7[0];for (int i = 0; i <= num7.length-1; i++){ if(num7[i] < x7) { x7 = num7[i]; }}System.out.println(x7);
- 5有关线程同步的概念中,哪一项是错误的?