Java Reference
In-Depth Information
23. t.print(12345L);
24. t.print(6.789);
A.
bytefloatObject
B.
intfloatObject
C.
byteObjectfloat
D.
intObjectfloat
E.
intObjectObject
F.
byteObjectObject
10.
Given the following interface and class defined in a file named Traceable.java, what is
the result of compiling this code?
1. public interface Traceable {
2. public static int MAX_TRACE;
3. public void trace();
4. }
5.
6. class Picture implements Traceable {
7. public void trace() {
8. System.out.println(“Tracing a picture”);
9. }
10. }
A.
Two bytecode files: Traceable.class and Picture.class
B.
One bytecode file: Traceable.class
C.
Compiler error on line 2
D.
Compiler error on line 3
E.
Compiler error on line 6
F.
Compiler error on line 7
11.
Given the following class definition:
1. public class Browser {
2. public static void addToFavorites(int id, String... urls) {
3. for(String url : urls) {
4. System.out.println(url);
5. }
6. }
7. }
which of the following statements are valid method calls to
addToFavorites
?
A.
Browser.addToFavorites(101);
B.
Browser.addToFavorites();
Search WWH ::
Custom Search