单选题为使下列代码正常运行,应该在下画线处填入的选项是______。
abstract class person{
public Person (String n){
name=n;
}
public______String getDescription();
public String getName(){
return name;
}
private string name;
}
单选题在执行下面这段Java程序时: public class Test { public static void main (String[] args) { String s1=args[0]; String s2=args[1]; String s3=args[2]; } }若编译程序后键入命令: java Test one two three,那么变量s1所引用的字符串为( )。
单选题如下程序段的输出结果为______。
publlic class Test{
public static void main(String[] args) {
int x, y;
x = (int) 56.3;
y = (int) "A";
System.out.print (x) ;
System.out.print(""/t"" +y);
}
}
单选题某序列的关键码序列为(33,18,25,67,82,53,95,12,70)。要按关键码值递增的顺序,采取以第一个关键码为基准元素的快速排序法,第一趟排序后关键码被放到第______个位置。 A.3 B.5 C.7 D.9
单选题能够用于创建可变字符串对象的类是______。 A.StringBuffer B.VariantString C.StringCharacte D.StringLong
单选题下面程序的输出结果是( )。 public class Sun public static void main(String args[ ]) int[] a=new int[11]; int[] p=new int[4]; int k=5; for (int i=1; i<=10; i++) a[i]=i; for(int i=1;i<=3;i++) p[i]=a[i*i]; for (int i=1; i<=3;i++) k=k+p [i]*2; System.out.println (k); A) 33 B) 28 C) 35 D) 37
单选题执行以下的循环后输出的值为( )。 public class Sun public static void main (String args[ ]) int m=1000, s=0, n=0; do n=n+l; s=s+(int)Math.pow(2,n); while (s<=m); System.out.println("n="+n+","+"s="+s);
单选题下面程序的输出结果是( )。 main() int num=0; while(num<=2) num++; printf("%d/n",num); A.1 2 3 4 B.1 2 3 C.1 2 D.1
单选题5+'5'和5+"5"的结果是( )。
单选题内部类可直接访问的是 ( ) A) 同一个程序的变量 B) 同一个包的变量 C) 定义它的外部类的变量 D) 其他包的变量
单选题下面程序段的输出结果为______。
package test;
public class ClassA
{
int x=20;
static int y=6;
public static void main(String args[])
{
ClassB b=new ClassB();
b. go(10);
System. out. println("x="+b. x);
}
}
class ClassB
{
int x;
void go(int y)
{
ClassA a=new ClassA();
x=a. y;
}
}
单选题下列Java源程序结构中前三种语句的次序,正确的是______。
A.import,package,public class
B.import必为首,其他不限
C.public class,package,import
D.package,import,public class
单选题下列可用作switch(expression)语句参数的是______。
单选题需求分析阶段最后提供的文档是软件的______。
单选题下列关于Applet的方法中, ( )是返回HTML中设定的值。
单选题有以下程序: #include <stdio.h> main() int x=011; printf("%d/n",++x); 程序运行后输出的结果是( )。 A.12 B.11 C.10 D.9
单选题能将程序补充完整的选项是______。 class Person private int a; phblic int change(int m)return m; public class Teacher extends Person public int b; public static void main(String arg[ ]) Person p=new Person( ); Teacher t=new Teacher( ); int i; ______;
单选题请选择下面File参数书写正确的一项( )。 A) File("d://file/test3.txt") B) File("d;//file//test3.txt") C) File("d:/file/test3.txt") D) File("d:/file//test3.txt")
单选题下列______不属于在本地系统执行所需安全策略的方法。
单选题下列代码的下划线处应填入相同的类,该类是______。 import
javax.swing.*; public class Test{ public
static void main(String args[]){ JFrame f=new
JFrame(); f.setTitle("Menus");
f.setVisible(true); f.setSize(500,400);
______mb=new______(); f.setJMenuBar(mb); JMenu
m=new JMenu("文件"); mb.add(m); JMenuItem mi=new
JMenuItem("打开"); m.add(mi); }
}
A.JMenuItem
B.JMenu
C.JFrame
D.JMenuBar
