更多JAVA程序设计试题
- 1给出下列程序,正确的输出是?class A {public static void main(String[] a) {int x = 5, y = 6;x += y--;y &= x;System.out.println("x="+ x + "\ty="+ y);}}
- 2public class Example01 {public static void main(String[] args) {int[] arr = { 4, 1, 6, 3, 9, 8 };// 定义一个数组int minIndex = 0;//初始时设第1个角标处的值为最小值for (int i = 1; i < arr.length; i++) {if (______) {minIndex = i;}}System.out.println("数组中的最小值为:"+arr[minIndex]);}}请问在上述程序的横线处填写下列哪段代码,可以求到数组的最小值
- 3嵌入式SQL实现时,采用预处理方式是()
- 4下面哪种流可以用于字符输入?
- 5下列程序运行结果是( )interface InterfaceA{String s="good ";void f();}abstract class ClassA{abstract void g();}class ClassB extends ClassA implements InterfaceA{void g(){System.out.print(s);}public void f(){System.out.print(" "+s);}}public class E {public static void main(String[] args) {ClassA a=new ClassB();InterfaceA b=new ClassB();a.g();b.f();}}
- 6下列有关接口的说法,正确的是()