网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
现有代码片段:String s="123";String sl=S+456;请问sl的结果是哪项?()
- A、123456
- B、579
- C、编译错误
- D、运行时抛出异常
参考答案
更多 “现有代码片段:String s="123";String sl=S+456;请问sl的结果是哪项?()A、123456B、579C、编译错误D、运行时抛出异常” 相关考题
考题
下面是一个类的定义,试将程序补充完整。class A{String s;____int a=66;A(String sl){s=sl;}static int geta(){return a;}}
考题
假定有以下函数过程: Function Fun(S As String) As String Dim sl As String For i=1 To Len(S) s1=UCase (Mid(S,i,1))+s1 Next i Fun=s1 End Function则Str2=Fun("abcdefg”)的输出结果为( )。A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA
考题
下列的哪个程序段可能导致错误? ( )A.String s="hello"; String t="good"; String k=s+t;B.String s="hello"; String t; t=s[3]+"one";C.String s="hello"; String standard=s.toUpperCase();D.String s="hello"; String t=s+"good";
考题
下列程序的执行结果是 public class Testff{ public static void main(String args[]){ String sl=new String("I am boy"); String s2=new String("I am boy"); System.out.println(sl==s2); } }A.真B.假C.I am boyD.都不正确
考题
下列代码的执行结果是( )。 public class Test{ public static void main String args[]){ String s1=new String("welcome"); String s2=new String("welcome"); System.out.println(s1==s2); System.out.println(s1.equals(s2)); } }A.false,falseB.false,trueC.true,trueD.true,false
考题
下列代码段的执行结果是( )。 public class Test { public static void main(String args[ ]) { String s1= new String("hello"); String s2= new String("hello"); System.out.println(s1==s2); System.out.println(s1.equal(s2)); } }A.true falseB.true trueC.false trueD.false false
考题
下列代码的执行结果是______。 public class ex55 { public static void main(String args[] ) { String s1=new String("hello"); String s2=new String("hello"); System.out.print (s1==s2); System.out.print (","); System.out.println (s1.equals (s2)); } }A.true, falseB.true, trueC.false, trueD.false, false
考题
下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[]args){ char char1[]='t','e','s','t'}; char char2[]={'t','e','s','t','1',}; String sl=new String(char1); String s2=new String(char2,0,4); System.out.println(S1.equals(s2)); } }A.真B.假C.testD.编译错误
考题
下列程序的执行结果为 Private Sub Commandl_Click() Dim s1 As String ,s2 As String s1= "abcd" Call Transfer(sl,s2) Print s2 End Sub Private Sub Transfer (ByVal xstr As String,ystr As String) Dim tempstr As String ystr=tempstr End SubA.dcbaB.abdcC.abcdD.dabc
考题
下述代码A和B正确的值是() Dim X As String = "123" Dim Y As Integer = 123 Dim A As String = X + Y Dim B As String = X YA“246”,“123123”B246,“123123”C“123123”,“123123”D123123,“123123”
考题
下面的哪些程序片断可能导致错误() A、String s = "Gone with the wind"; String t = " good "; String k = s + t;B、String s = "Gone with the wind"; String t; t = s[3] + "one";C、String s = "Gone with the wind"; String standard = s.toUpperCase();D、String s = "home directory"; String t = s - "directory"
考题
下面的哪些程序片段可能导致错误()。 A、String s = “Gone with the wind”; String t = “ good”; String k = s + t;B、String s = “Gone with the wind”; String t; t = s[3] + “one”;C、String s = “Gone with the wind”; String standard = s.toUpperCase();D、String s = “home directory”; String t = s – “directory”;
考题
下述代码A和B正确的值是() Dim X As String = "123" Dim Y As Integer = 123 Dim A As String = X + Y Dim B As String = X YA、“246”,“123123”B、246,“123123”C、“123123”,“123123”D、123123,“123123”
考题
预测以下代码片段的输出结果:() var str ; alert(typeof str);A、. string ;B、. undefined;C、. object ;D、. String;
考题
现有: import java.util.*; class ScanStuff { public static void main (String [] args) { String S= "x,yy,123"; Scanner sc = new Scanner (s); while (sc.hasNext()) System.out.print (sc.next() +" "); } } 结果是什么?() A、 x yyB、 x,yy,123C、 x yy 123D、 x,yyE、编译失败F、运行的时候有异常抛出
考题
Which of the following fragments might cause errors?() A、 String s = "Gone with the wind";String t = " good ";String k = s + t;B、 String s = "Gone with the wind";String t;t = s[3] + "one";C、 String s = "Gone with the wind";String standard = s.toUpperCase();D、 String s = "home directory";String t = s - "directory";
考题
多选题下面的哪些程序片段可能导致错误()。AString s = “Gone with the wind”; String t = “ good”; String k = s + t;BString s = “Gone with the wind”; String t; t = s[3] + “one”;CString s = “Gone with the wind”; String standard = s.toUpperCase();DString s = “home directory”; String t = s – “directory”;
考题
单选题import java.util.*; class ScanStuff { public static void main(String [] args) { String s = "x,yy,123"; Scanner sc = new Scanner(s); while (sc.hasNext()) System.out.print(sc.next() + " "); } } 结果是什么?()A
x yyB
x,yyC
x yy 123D
x,yy,123
考题
单选题下述代码A和B正确的值是() Dim X As String = "123" Dim Y As Integer = 123 Dim A As String = X + Y Dim B As String = X YA
“246”,“123123”B
246,“123123”C
“123123”,“123123”D
123123,“123123”
考题
单选题预测以下代码片段的输出结果:() var str ; alert(typeof str);A
. string ;B
. undefined;C
. object ;D
. String;
考题
单选题现有: import java.util.*; class ScanStuff { public static void main (String [] args) { String S= "x,yy,123"; Scanner sc = new Scanner (s); while (sc.hasNext()) System.out.print (sc.next() +" "); } } 结果是什么?()A
x yyB
x,yy,123C
x yy 123D
x,yyE
编译失败F
运行的时候有异常抛出
考题
单选题现有代码片段:String s="123";String sl=S+456;请问sl的结果是哪项?()A
123456B
579C
编译错误D
运行时抛出异常
热门标签
最新试卷