|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#55. Given: 1. public class SyncTest ( 2. private int x; 3. private int y; 4. private synchronized void setX (int i) (x=1;) 5. private synchronized void setY (int i) (y=1;) 6. public void setXY(int 1)(set X(i); setY(i);) 7. public synchronized Boolean check () (return x !=y; ) 8. )
Under which conditions will check ()return true when called from a different class?
Show comments for this question (0)
Add comments
Link to this question
|
|
#56. Exhibit: 1. class A implements runable ( 2. int i; 3. public void run () ( 4. try ( 5. thread.sleep(5000); 6. i= 10; 8. ) 9. ) 10. 11. public class Test { 12. public static void main (string args[]) ( 13. try ( 14. A a = new A (); 16. t.start(); 17. 18. int j= a.i; 19. 21. ) 22. )
Which statement al line 17 will ensure that j=10 at line 19?
Show comments for this question (0)
Add comments
Link to this question
|
|
#60. Given: AnInterface is an interface. AnAdapter0 is a non-abstract,non-final class with a zero argument constructor. AnAdapter1 is a non-abstract,non-final class without a zero argument constructor,but with a constructor that takes one int argument. Which two construct an anonymous inner class? (Choose Two)
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.368
|
Server date 06:31 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|