domingo, 21 de febrero de 2010

Material Ultima para Examen Sun Java

Examen sun, Upgrade exam for the Sun Certified for Java Programmer.SE6.0,cuenta con 93 Preguntas y respuestas y además ,era actualizado en15-enero-2010

He aquí una parte del examen

1. Given:

11. public class Test {

12. public enum Dogs {collie, harrier, shepherd};

13. public static void main(String [] args) {

14. Dogs myDog = Dogs.shepherd;

15. switch (myDog) {

16. case collie:

17. System.out.print("collie ");

18. case default:

19. System.out.print("retriever ");

20. case harrier:

21. System.out.print("harrier ");

22. }

23. }

24. }

What is the result?

A.harrier

B.shepherd

C.retriever

D.Compilation fails.

E.retriever harrier

F.An exception is thrown at runtime.

Answer:D

2. Given:

10. interface Foo {}

11. class Alpha implements Foo {}

12. class Beta extends Alpha {}

13. class Delta extends Beta {

14. public static void main( String[] args ) {

15. Beta x = new Beta();

16. // insert code here

17. }

18. }

Which code, inserted at line 16, will cause a java.lang.ClassCastException?

A.Alpha a = x;

B.Foo f = (Delta)x;

C.Foo f = (Alpha)x;

D.Beta b = (Beta)(Alpha)x;

Answer:B

3. 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:/opt/java/lib/*.jarWhat is

a possible location for the Chess.class file?

A./test/Chess.class

B./home/bob/Chess.class

C./test/games/Chess.class

D./usr/lib/games/Chess.class

E./home/bob/games/Chess.class

F.inside jarfile /opt/java/lib/Games.jar (with a correct manifest)

G.inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)

Answer:C

puede conocer mucho viendo la página de http://www.killtest.es/SUNOtherCertifications/310-066.asp

No hay comentarios:

Publicar un comentario