单项选择题

Given the fully-qualified class names: 
com.foo.bar.Dog 
com.foo.bar.blatz.Book 
com.bar.Car 
com.bar.blatz.Sun 
Which graph represents the correct directory structure for a JAR file from which those classes can be used by the compiler and JYM?() 

A. Jar A
B. Jar B
C. Jar C
D. Jar D
E. Jar E


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

A class games.cards.Poker is correctly defined in the jar file Poker.jar. 
A user wants to execute the main method of Poker on a UNIX system using the command: 
java games.cards.Poker 
What allows the user to do this?() 

A. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java
B. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jar
C. Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/Poker.jar
D. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java
E. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuffijava/*.jar
F. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/Poker.jar

3.单项选择题

11. class Snoochy { 
12. Boochybooch; 
13. public Snoochy() { booch = new Boochy(this); } 
14. } 
15. 
16. class Boochy { 
17. Snoochy snooch; 
18. public Boochy(Snoochy s) { snooch = s; } 
19. } 
And the statements: 
21. public static void main(String[] args) { 
22. Snoochy snoog = new Snoochy(); 
23. snoog = null; 
24. // more code here 
25. } 
Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?() 

A. None of these objects are eligible for garbage collection.
B. Only the object referenced by booch is eligible for garbage collection.
C. Only the object referenced by snoog is eligible for garbage collection.
D. Only the object referenced by snooch is eligible for garbage collection.
E. The objects referenced by snooch and booch are eligible for garbage collection.

8.单项选择题

public class ItemTest { 
private final mt id; 
public ItemTest(int id) { this.id = id; } 
public void updateId(int newId) { id = newId; } 
public static void main(String[] args) { 
ItemTest fa = new ItemTest(42); 
fa.updateId(69); 
System.out.println(fa.id); 
} 
} 
What is the result?() 

A. Compilation fails.
B. An exception is thrown at runtime.
C. The attribute id in the Item object remains unchanged.
D. The attribute id in the Item object is modified to the new value.
E. A new Item object is created with the preferred value in the id attribute.