String a = “ABCD”; String b = a.toLowerCase(); b.replace(‘a’, ‘d’); b.replace(‘b’, ‘c’); System.out.println(b); What is the result? ()
A: abcd
B: ABCD
C: dccd
D: dcba
E: Compilation fails.
F: An exception is thrown at runtime.
A: abcd
B: ABCD
C: dccd
D: dcba
E: Compilation fails.
F: An exception is thrown at runtime.
举一反三
- System.out.println(Math.sqrt(-4D)); What is the result?() A: –2 B: NaN C: Infinity D: Compilation fails. E: An exception is thrown at runtime.
- 11. String test = “This is a test”; 12. String[] tokens = test.split(”\s”); 13. System.out.println(tokens.length); What is the result?() A: 0 B: 1 C: 4 D: Compilation fails. E: An exception is thrown at runtime.
- 11. String test = “This is a test”; 12. String[] tokens = test.split(”\s”); 13. System.out.println(tokens.length); What is the result?() A: 0 B: 1 C: 4 D: Compilation fails. E: An exception is thrown at runtime.
- Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("\s"); 13. System.out.println(tokens.length); What is the result?() A: An exception is thrown at runtime. B: 1 C: 4 D: Compilation fails. E: 0
- Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("\s"); 13. System.out.println(tokens.length); What is the result?() A: An exception is thrown at runtime. B: 1 C: 4 D: Compilation fails. E: 0