|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#54. Given a class Repetition: 1. package utils; 2. 3. public class Repetition 5. }
and given another class Demo: 1. //insert code here 2. 3. public class Demo { 4. public static void main (String[] args ) { 5. System. out. println(twice (“pizza” )); 6. } 7. }
Which code should be inserted at line 1 of Demo.java to compile and run Demo to print “pizzapizza”?
Show comments for this question (0)
Add comments
Link to this question
|
|
#55. Given classes defined in two different files: 1. package packageA; 2. public class Message { 3. String getText () { return “text”; } 4. }
and; 1. package packageB; 2. public class XMLMessage extends packageA.Message { 3. String getText () { return “<msg>text</msg>”; } 4. public static void main (String[] args ) { 5. System. out. println(new XMLMessage (). getText()); 6. } 7. }
What is the result of executing XMLMessage.main?
Show comments for this question (0)
Add comments
Link to this question
|
|
#57. Click the Exhibit button. Given the fully-qualified class names: com .foo .bar.Dog com.foo.bar.bla.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 JVM?
Show comments for this question (0)
Add comments
Link to this question
|
|
#58. Given: 1. public class Score implements Comparablec<Score> { 2. private int wins, losses; 3. public Score(int w, int I) { wins = w; losses = I; } 4. public int getWins() { return wins; } 5. public int getLosses() { return losses; } 7. return “<“ + wins + “,“ + losses +“>“; 6. } 9. //insert code here 10.}
Which method will complete this class?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.249
|
Server date 06:29 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|