|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#96. A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where the old one is installed. Bob is currently able to run a Java chess program starting from his home directory/home/bob using the command: java -classpath /test:/home/bob/downloads/*.jar games.Chess Bob’s CLASSPATH is set (at login time) to: /usr/lib:/home/bob/classes:/opt/java/lib:/opava/lib/*.jar What is a possible location for the Chess.class file?
Show comments for this question (0)
Add comments
Link to this question
|
|
#97. Given: 1. interface DoStufl’2 { 2. float getRange(int low, mt high); } 3. 4. interface DoMore { 5. float getAvg(int a, int b, int c); } 6. 7. abstract class DoAbstract implements DoStuff2, DoMore { } 8. 9. class DoStuff implements DoStuff2 { 10. public float getRange(int x, int y) { return 3.14f; } } 11. 12. interface DoAII extends DoMore { 13. float getAvg(int a, int b, int c, int d); }
What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
#98. Given classes defined in two different files: 1. package util; 2. public class BitUtils { 3. public static void process(byte[]) { /* more code here */ } 4. } 1. package app; 2. public class SomeApp { 3. public static void main (String[] args ) { 4. byte[] bytes = new byte[256]; 5. // insert code here 6. } 7. }
What is required at line 5 in class SomeApp to use the process method of BitUtils?
Show comments for this question (0)
Add comments
Link to this question
|
|
#99. Given: 1. package com.company.application; 2. 3. public class MainClass 4. public static void main (String[] args ) {} 5
And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to “.“ (current directory). Which two java commands entered at the command line will run MainClass? (Choose two.)
Show comments for this question (0)
Add comments
Link to this question
|
|
#100. Given: 10. public class SuperCalc { 11. protected static mt multiply(int a, mt b) { return a * b;} 12. }
and: 20. public class SubCalc extends SuperCalc{ 21. public static int multiply(int a, int b) { 22. int c = super.multiply(a, b); 23. return c; 24. } 25. }
and: 30. SubCalc sc = new SubCalc (); 31. System. out. println(sc. multiply(3, 4)); 32. System. out. println(SubCalc. multiply(2, 2));
What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.334
|
Server date 05:32 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|