Stream result = stream.newStream(System.out);
StreamResult result = new StreamResult(System.out);
Stream result = new Stream(System.out);
StreamResult result = DOMSource.newStreamResult(System.out);
第1题:
有如下程序: public class MethLoad { public static void main(String args[]) { MethLoad classObj = new MethLoad(); classObj.methtest(4); classObj.methtest(4.0); } void methtest(double D) { double sum = 2*d; System.out.println("The result is:"+sum); } void methtest(int n) { int sum = 4*n; System.out.println("The result is:"+sum); } } 程序的运行结果为( )。
A.The result is:16 The result is:8.0
B.The result is:8.0 The resuR is:16
C.The result is:8 The result is:16.0
D.The resuR is:16.0 The result is:8
第2题:
在J2EE中,下面的代码中出现编译错误的是()。
A.Filef=newFile("/","autoexec.bat");
B.DataInput Streamdin=new Data Input Stream(new File Input Stream("autoexec.bat"));
C.Input Stream Readerin=new Input Stream Reader(System.in);
D.Output Stream Writer out=new Output Stream Writer(System.in);
第3题:
1)#include
2)using namespace std;
3)int main()
4){
5)int a,b,result;
6)cout<<"please input two numbers:\n";
7)cin>>a>>b;
8)result=3*a-2*b+1;
9)cout<<"resultis"<< result<< endl;
10)}
程序的第5行中的cout表示:()
A、显示字符串
B、标准输出的流设备
C、标准输入的流设备
D、程序入口
第4题:
请看代码,回答下面的问题。
Type
TMammal=Class
Procedure Walk;
…..
end;{end of TManmml}
procedure TMammal.Walk;
begin
ShowMessage(‘Result is Mammal Walk’);
end;
TDog=Class(TMammal)
Procedure Walk;
end;
procedure TDog.Walk;
begin
ShowMessage(‘Result is Dog Walk’);
end;
var
Mammal:TMammal;
dog:TDog;
begin
Mammal:=TDog.Create;
Mammal.Walk;
Mammal.Free;
end;
上面代码中,最后的输出结果是:( )
A.‘Result is Dog Walk’
B.‘Result ia Mannal Walk’
第5题:
以下代码的输出结果是() while(1) { $var++; $result=$var; if($result==17)break; $var--; } echo($result);
第6题:
System.out是()类的对象,称为标准输出流,调用System类的()方法可以实现标准输出流的重定向。
第7题:
在J2EE中,用JAXP转化XML文档,可以创建输出流把数据输出到屏幕上,以下创建该输出流的代码是()
第8题:
Stream result = stream.newStream(System.out)
StreamResult result = new StreamResult(System.out)
Stream result = new Stream(System.out)
StreamResult result = DOMSource.newStreamResult(System.out)
第9题:
Collections. sort(a, a.reverse()); int result = Collections.binarySearch(a, “6”);
Comparator c = Collections.reverseOrder(); Collections.sort(a, c); int result = Collections.binarySearch(a, “6”);
Comparator c = Collections.reverseOrder(); Collections.sort(a, c); int result = Collections.binarySearch(a, “6”,c);
Comparator c = Collections.reverseOrder(a); Collections.sort(a, c); int result = Collections.binarySearch(a, “6”,c);
Comparator c = new InverseComparator(new Comparator()); Collections.sort(a); int result = Collections.binarySearch(a, “6”,c);
第10题:
0
17
18
这是一个无限循环,没有输出
第11题:
a
b
97
98
第12题:
显示字符串
标准输出的流设备
标准输入的流设备
程序入口
第13题:
在窗体中使用一个文本框名为n.接受输入的值,有一个命令按钮run,事件代码如下: Private Sub run_Click( ) result = "" For i = 1 To Me!n For j = 1 To Me!n result = result + "*" Next j result = result + Chr(13) + Chr(10) Next i MsgBox result End Sub 打开窗体后,如果通过文本框输入的值为4,单击命令按钮后输出的图型是
A. * * * * * * * * * * * * * * * *
B. * * * * * * * * * * * * * * * *
C. * * * * * * * * * * * * * * * * * * * * * * * * * * * *
D. * * * * * * * * * * * * * * * *
第14题:
写出下面程序的输出( )。 public class Test { public static void main (String args[ ]) { iht x=1, y=2; System. out. println ("result="+x+y); System. out. println ("result="+(x+y));
A.result=12 result=12
B.result=3 result=3
C.result=3 result=12
D.result=12 result=3
第15题:
有如下程序: public class MethLoad { public static void main(String args[]) { MethLoad classObj=new MethLoad(); classObj.methtest(4); classObj.methtest(0); } void methtest(double d) { double sum=2*d; System.out.println("The result is:"+sum); } void methtest(int n) { int sum=4*n; System.out.println("The result is:" +sum); } }程序的运行结果为( )。
A.The result is:16 The result is:0
B.The result is:0 The result is:16
C.The result is:8 The result is:0
D.The result is:0 The result is:8
第16题:
此题为判断题(对,错)。
第17题:
class TestApp{ public static void main(String[] args){ System.out.println(multiply(2,3,4,5)); } public int multiply(int… nums){ int result = 1; for(int x :nums) result *= x; //result =result*x; return result; } } 2、6、24、120 程序运行后的输出是哪项?()
第18题:
Java语言中的System.out表示标准(输入/输出)()流。
第19题:
Given: ArrayList a = new ArrayList(); containing the values {“1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”} Which code will return 2?()
第20题:
a
b
97
98
第21题:
第22题:
第23题:
14
编译错误
120
24