对
错
第1题:
下列的哪个程序段可能导致错误? ( )
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";
第2题:
当执行下列宏定义命令后,S的值为 ( ) # defineR3.0 # define PI 3.1415926 # define L2 * PI * R # define S PI * R * R
A.3.1415926
B.18.849556
C.3
D.28.2743334
第3题:
此题为判断题(对,错)。
第4题:
下面的哪些程序片断可能导致错误()
第5题:
class A { public String toString () { return “4”; } } class B extends A { 8. public String toString () { return super.toString() + “3”; } } public class Test { public static void main(Stringargs) { System.out.printIn(new B()); } } What is the result?()
第6题:
将逻辑值赋值给内存变量STRING1的正确方法是()
第7题:
关于国际化,下面那句话是错误的是()
第8题:
Given: 310-025 Leading the way in IT testing and certification tools, www.testking.com - 48 - public class foo { static String s; public static void main (Stringargs) { system.out.printIn (“s=” + s); } } What is the result?()
第9题:
Which of the following fragments might cause errors?()
第10题:
1
2
3
4
5
6
第11题:
Compilation succeeds and 4 is printed.
Compilation succeeds and 43 is printed.
An error on line 9 causes compilation to fail.
An error on line 14 causes compilation to fail.
Compilation succeeds but an exception is thrown at line 9.
第12题:
The code compiles and “s=” is printed.
The code compiles and “s=null” is printed.
The code does not compile because string s is not initialized.
The code does not compile because string s cannot be referenced.
The code compiles, but a NullPointerException is thrown when toString is called.
第13题:
下面这段代码会产生( )个String对象。
Strings1="hello";
Strings2=s1.substring(2,3);
Strings3=s1.toString();
Strings4=newStringBuffer(s1).toString();
A、1
B、2
C、3
D、4
第14题:
此题为判断题(对,错)。
第15题:
此题为判断题(对,错)。
第16题:
public class foo { public static void main (Stringargs) { String s; system.out.printIn (“s=” + s); } } What is the result?()
第17题:
public String makinStrings() { String s = “Fred”; s = s + “47”; s = s.substring(2, 5); s = s.toUpperCase(); return s.toString(); } How many String objects will be created when this method is invoked?()
第18题:
下面哪个不是String类的方法?()
第19题:
String s = (Double.valueOf("3.1415926")).toString()。
第20题:
public class foo { public static void main (String[]args) { String s; system.out.printIn (“s=” + s); } } What is the result?()
第21题:
1. interface TestA { String toString(); } 2. public class Test { 3. public static void main(String[] args) { 4. System.out.println(new TestA() { 5. public String toString() { return “test”; } 6. } 7. } 8. } What is the result?()
第22题:
The code compiles and “s=” is printed.
The code compiles and “s=null” is printed.
The code does not compile because string s is not initialized.
The code does not compile because string s cannot be referenced.
The code compiles, but a NullPointerException is thrown when toString is called.
第23题:
The code compiles and “s=” is printed.
The code compiles and “s=null” is printed.
The code does not compile because string s is not initialized.
The code does not compile because string s cannot be referenced.
The code compiles, but a NullPointerException is thrown when toString is called.