Cause error during compilation.
south east
south to north east to west
south to north east
south east to west
第1题:
在执行下面这段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所引用的字符串为( )。
A.null
B.test
C.one
D.java
第2题:
阅读下面代码 public class Test { String s="One World One Dream"; public static void main(String[] args) { System.out.println(s); } } 其运行的结果是
A.args
B.World One Dream
C.s
D.编译时出错
第3题:
有如下程序:
#include
using namespace std;
class PARENT
{
public:
PARENT(){cout<<"PARENT";}
};
class SON:public PARENT
{
public:
SON(){cout<<"SON";}
};
int main()
{
SON son;
PARENT *p;
p = &son;
return 0;
}
执行上面程序的输出是 【 12 】 。
第4题:
关于下列代码编译或执行结果的描述中,正确的是( )。 public class Test{ public static void main(String argsE]){ TcstThread pml=new TestThread("One") pml.start; TestThread pm2=new TestThread("Tw0") pm2.start; } } class TestThread extends Thread( private String sTname=""; TestThread(String s){ sTname=s; } public void run{ for(int i=O;i<2;i++){ try{ sleep(1000); }catch(InterruptedException e){} system.out.print(sTname+""); } } }
A.不能通过编译,TestThread类中不能定义变量和构造方法
B.输出One One Two Two
C.输出Two One One Two
D.选项B或C都有可能出现
第5题:
有如下程序:
include <iostream>
using namespace std;
class PARENT
{
public:
PARENT() { cout <<"PARENT"; }
};
class SON : public PARENT
{
public:
SON() {cout << "SON"; }
};
int main()
{
SON son;
PARENT *p;
p = &son;
return 0;
}
执行上面程序的输出是______。
第6题:
You have recently created a serializable class named Vehicle.The class is shown below:[Serializable]public class Vehicle{public string VIN;public string Make;public string Model;public string Year;}You are planning to create a custom formatter class to control the formatting of Vehicle objects when they are serialized.You need to ensure that is achieved with as little development effort as possible.What should you do?()
A.
B.
C.
D.
第7题:
下列语句能给数组赋值而不使用for循环的是
A.myArray{[1]="One";[2]="Two";[3]="Three";}
B.String s[5]=new String[]{"Zero", "One", "Two", "There", "Four"};
C.String s[]=new String[]{"Zero", "One", "Two", "There", "Four"};
D.String s[]=new String[]=|"Zero", "One", "Two", "There", "Four"};
第8题:
阅读下列代码 public class Test{ String s="One World One Dream"; public static void main(String args[]){ System. out. println(s); } } 其运行结果是
A.args
B.One World One Dream
C.s
D.编译时出错
第9题:
下列代码的输出结果是( )。
class parent
{
void printme()
{
System.out.println("parent");
}
}
class child extends parent
{
void printme()
{
System. out.println("child");
}
void printall()
{
super, printme();
this.printme();
printme();
}
}
public class test
{
public static void main(String args[])
{
child myc=new child();
myc.printall();
}
}
A.import java.awt.*;
B.import java.applet.applet;
C.import java.io.*;
D.import java, awt.graphics;
第10题:
下列语句能给数组赋值,而不使用for循环的是
A.myArray{[1]="One";[2]="Two";[3]="Three";}
B.String s[5]=new String[] {"Zero","One","Two","Three","Four"};
C.String s[]=new String[] {"Zero","One","Two","Three","Four"};
D.String s[]=new String[]= {"Zero","One","Two","Three","Four"};