Java Reference
In-Depth Information
13. }
14.
15. if(t.equals(s)) {
16. System.out.print(“three”);
17. }
A. one
B. onethree
C. twothree
D. onetwothree
E. The code does not compile.
8. What is the result of the following code?
NumberFormat fmt =
NumberFormat.getCurrencyInstance(Locale.US);
float f = 99.999F;
System.out.println(fmt.format(f));
A. $99.99
B. $99.999
C. $100.00
D. 99.999
E. The output is indeterminate and depends on the locale of the JVM environment.
9. What is the result of the following code?
7. StringBuilder sb = new StringBuilder();
8. sb.append(“aaa”).insert(1, “bb”).insert(4, “ccc”);
9. System.out.println(sb);
A. bbaaaccc
B. abbaaccc
C. abbaccca
D. bbaaccca
E. The code does not compile.
10. Given the following class definition:
1. import java.io.*;
2.
3. public class MyReader {
4. BufferedReader in;
5.
Search WWH ::




Custom Search