ourexamdll's picture
From ourexamdll rss RSS  subscribe Subscribe

Ourexam 310-055 PDF free dwonload 

 

 
 
Tags:  310-055  PDF 
Views:  211
Published:  March 09, 2010
 
0
download

Share plick with friends Share
save to favorite
Report Abuse Report Abuse
 
Related Plicks
Mac PDF to Image Converter - PDF to Images Converter for Mac

Mac PDF to Image Converter - PDF to Images Converter for Mac

From: gaopengyulnfi
Views: 623 Comments: 0
Mac PDF to image Converter is an excellent PDF to image converting software convert PDF to

image JPG (JPEG), PDF to TIFF, PDF to PNG, PDF to BMP on Mac.

 
PDF Converter, PDF Converter is easy to use

PDF Converter, PDF Converter is easy to use

From: gaopengyulnfi
Views: 511 Comments: 0
PDF Converter is an easy-to-handle yet powerful PDF converting program. Barely several mouse clicks, you can read PDF content on the web, extract PDF content, save it as image and more.
 
pdf-merger

pdf-merger

From: d2m0412
Views: 480 Comments: 0

 
See all 
 
More from this user
Ourexam HP0-081 PDF free share

Ourexam HP0-081 PDF free share

From: ourexamdll
Views: 327
Comments: 0

Ourexam HP certification HP2-896 exam

Ourexam HP certification HP2-896 exam

From: ourexamdll
Views: 222
Comments: 0

Ourexam HP2-037 study guide

Ourexam HP2-037 study guide

From: ourexamdll
Views: 410
Comments: 0

Ourexam 642-982 exam

Ourexam 642-982 exam

From: ourexamdll
Views: 218
Comments: 0

Ourexam LOT-711 study guide

Ourexam LOT-711 study guide

From: ourexamdll
Views: 255
Comments: 0

 
See all 
 
 
 URL:          AddThis Social Bookmark Button
Embed Thin Player: (fits in most blogs)
Embed Full Player :
 
 

Name

Email (will NOT be shown to other users)

 

 
 
Comments: (watch)
 
 
Notes:
 
Slide 1: o urexam
Slide 2: The safer , easier way to help you pass any IT exams. Exam : 310-055 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : DEMO 1 / 12
Slide 3: The safer , easier way to help you pass any IT exams. 1.Which Man class properly represents the relationship "Man has a best friend who is a Dog"? A.class Man extends Dog { } B.class Man implements Dog { } C.class Man { private BestFriend dog; } D.class Man { private Dog bestFriend; } E.class Man { private Dog; } F.class Man { private BestFriend; } Answer:D 2.Given: 1. package test; 2. 3. class Target { 4. public String name = "hello"; 5. } What can directly access and change the value of the variable name? A.any class B.only the Target class C.any class in the test package D.any class that extends Target Answer:C 3.Click the Task button. Answer: Green choice1---->Yellow Choice1 Green choice2---->Yellow Choice2 Green choice3---->Yellow Choice3 Green choice2---->Yellow Choice5 Green choice5---->Yellow Choice6 Green choice1---->Yellow Choice4 4.Given: 1. class ClassA { 2. public int numberOfInstances; 3. protected ClassA(int numberOfInstances) { 4. this.numberOfInstances = numberOfInstances; 5. } 6. } 7. public class ExtendedA extends ClassA { 8. private ExtendedA(int numberOfInstances) { 9. super(numberOfInstances); 10. } 11. public static void main(String[] args) { 12. ExtendedA ext = new ExtendedA(420); 13. System.out.print(ext.numberOfInstances); 14. } 15. } Which statement is true? A.420 is the output. 2 / 12
Slide 4: The safer , easier way to help you pass any IT exams. B.An exception is thrown at runtime. C.All constructors must be declared public. D.Constructors CANNOT use the private modifier. E.Constructors CANNOT use the protected modifier. Answer:A 5.Given: 10. interface Jumper { public void jump(); } ... 20. class Animal {} ... 30. class Dog extends Animal { 31. Tail tail; 32. } ... 40. class Beagle extends Dog implements Jumper{ 41. public void jump() {} 42. } ... 50. class Cat implements Jumper{ 51. public void jump() {} 52. } Which three are true? (Choose three.) A.Cat is-a Animal B.Cat is-a Jumper C.Dog is-a Animal D.Dog is-a Jumper E.Cat has-a Animal F.Beagle has-a Tail G.Beagle has-a Jumper Answer:B C F 6.Given: 10: public class Hello { 11: String title; 12: int value; 13: public Hello() { 14: title += " World"; 15: } 16: public Hello(int value) { 17: this.value = value; 18: title = "Hello"; 19: Hello(); 20: } 21: } and: 30: Hello c = new Hello(5); 31: System.out.println(c.title); What is the result? A.Hello B.Hello World C.Compilation fails. D.Hello World 5 E.The code runs with no output. F.An exception is thrown at runtime. Answer:C 7.Given: 10. interface A { public int getValue(); } 11. class B implements A { 12. public int getValue() { return 1; } 13. } 14. class C extends B { 15. // insert code here 16. } Which three code fragments, inserted individually at line 15, make use of polymorphism? (Choose three.) A.public void add(C c) { c.getValue(); } B.public void add(B b) { b.getValue(); } C.public void add(A a) { a.getValue(); } D.public void add(A a, B b) { a.getValue(); } E.public void add(C c1, C c2) { c1.getValue(); } Answer:B C D 8.Given: 20. public class CreditCard { 21. 22. private String cardID; 23. private Integer limit; 24. public String ownerName; 25. 26. public void setCardInformation(String cardID, 27. String ownerName, 28. Integer limit) { 29. this.cardID = cardID; 30. this.ownerName = ownerName; 31. this.limit = limit; 32. } 33. } Which statement is true? A.The class is fully encapsulated. B.The code demonstrates polymorphism. C.The ownerName variable breaks encapsulation. D.The cardID and limit variables break polymorphism. E.The setCardInformation method breaks encapsulation. 3 / 12
Slide 5: The safer , easier way to help you pass any IT exams. Answer:C 9.Given: 1. class Super { 2. private int a; 3. protected Super(int a) { this.a = a; } 4. } ... 11. class Sub extends Super { 12. public Sub(int a) { super(a); } 13. public Sub() { this.a = 5; } 14. } Which two, independently, will allow Sub to compile? (Choose two.) A.Change line 2 to: public int a; B.Change line 2 to: protected int a; C.Change line 13 to: public Sub() { this(5); } D.Change line 13 to: public Sub() { super(5); } E.Change line 13 to: public Sub() { super(a); } Answer:C D 10.Given: 11. class ClassA {} 12. class ClassB extends ClassA {} 13. class ClassC extends ClassA {} and: 21. ClassA p0 = new ClassA(); 22. ClassB p1 = new ClassB(); 23. ClassC p2 = new ClassC(); 24. ClassA p3 = new ClassB(); 25. ClassA p4 = new ClassC(); Which three are valid? (Choose three.) A.p0 = p1; B.p1 = p2; C.p2 = p4; D.p2 = (ClassC)p1; E.p1 = (ClassB)p3; F.p2 = (ClassC)p4; Answer:A E F 11.Given: 1. public class Threads2 implements Runnable { 2. 3. public void run() { 4. System.out.println("run."); 5. throw new RuntimeException("Problem"); 6. } 7. public static void main(String[] args) { 8. Thread t = new Thread(new Threads2()); 9. t.start(); 10. System.out.println("End of method."); 11. } 12. } Which two can be results? (Choose two.) A.java.lang.RuntimeException: Problem B.run. java.lang.RuntimeException: Problem C.End of method. java.lang.RuntimeException: Problem D.End of method. run. java.lang.RuntimeException: Problem E.run. java.lang.RuntimeException: Problem End of method. Answer:D E 12.Given: 1. public class TestOne { 2. public static void main (String[] args) throws Exception { 3. Thread.sleep(3000); 4. System.out.println("sleep"); 5. } 6. } What is the result? A.Compilation fails. B.An exception is thrown at runtime. C.The code executes normally and prints "sleep". D.The code executes normally, but nothing is printed. Answer:C 13.Given: 1. public class Threads3 implements Runnable { 2. public void run() { 3. System.out.print("running"); 4. } 5. public static void main(String[] args) { 6. Thread t = new Thread(new Threads3()); 7. t.run(); 8. t.run(); 9. t.start(); 10. } 11. } What is the result? A.Compilation fails. B.An exception is thrown at runtime. C.The code executes and prints "running". D.The code executes and prints "runningrunning". 4 / 12
Slide 6: The safer , easier way to help you pass any IT exams. E.The code executes and prints "runningrunningrunning". Answer:E 14.Click the Exhibit button. Which two are possible results? (Choose two.) A.0, 2, 4, 4, 6, 8, 10, 6, B.0, 2, 4, 6, 8, 10, 2, 4, C.0, 2, 4, 6, 8, 10, 12, 14, D.0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, E.0, 2, 4, 6, 8, 10, 12, 14, 0, 2, 4, 6, 8, 10, 12, 14, Answer:A C 15.Click the Exhibit button. What is the result? 5 / 12
Slide 7: The safer , easier way to help you pass any IT exams. A.The code will deadlock. B.The code may run with no output. C.An exception is thrown at runtime. D.The code may run with output "0 6". E.The code may run with output "2 0 6 4". F.The code may run with output "0 2 4 6". Answer:F 16.Click the Task button. 6 / 12
Slide 8: The safer , easier way to help you pass any IT exams. Answer: Green choice1---->Yellow Choice1 Green choice1---->Yellow Choice2 Green choice2---->Yellow Choice3 Green choice2---->Yellow Choice4 Green choice2---->Yellow Choice5 Green choice2---->Yellow Choice6 17.Which two code fragments will execute the method doStuff() in a separate thread? (Choose two.) A.new Thread() { public void run() { doStuff(); } }; B.new Thread() { public void start() { doStuff(); } }; C.new Thread() { public void start() { doStuff(); } }.run(); D.new Thread() { public void run() { doStuff(); } }.start(); E.new Thread(new Runnable() { public void run() { doStuff(); } }).run(); F.new Thread(new Runnable() { public void run() { doStuff(); } }).start(); Answer:D F 18.Given: public class NamedCounter { private final String name; private int count; public NamedCounter(String name) { this.name = name; } public String getName() { return name; } public void increment() { count++; } public int getCount() { return count; } public void reset() { count = 0; } } Which three changes should be made to adapt this class to be used safely by multiple threads? (Choose three.) A.declare reset() using the synchronized keyword B.declare getName() using the synchronized keyword C.declare getCount() using the synchronized keyword D.declare the constructor using the synchronized keyword E.declare increment() using the synchronized keyword Answer:A C E 19.Click the Task button. 7 / 12
Slide 9: The safer , easier way to help you pass any IT exams. Answer: Green choice1---->Yellow Choice1 Green choice5---->Yellow Choice2 Green choice8---->Yellow Choice5 Green choice7---->Yellow Choice3 Green choice16---->Yellow Choice4 20.Given: 1. import java.util.*; 2. public class WrappedString { 3. private String s; 4. public WrappedString(String s) { this.s = s; } 5. public static void main(String[] args) { 6. HashSeths = new HashSet(); 7. WrappedString ws1 = new WrappedString("aardvark"); 8. WrappedString ws2 = new WrappedString("aardvark"); 9. String s1 = new String("aardvark"); 10. String s2 = new String("aardvark"); 11. hs.add(ws1); hs.add(ws2); hs.add(s1); hs.add(s2); 12. System.out.println(hs.size()); } } What is the result? A.0 B.1 C.2 D.3 E.4 F.Compilation fails. G.An exception is thrown at runtime. Answer:D 21.Click the Task button. 8 / 12
Slide 10: The safer , easier way to help you pass any IT exams. Answer: Green choice10---->Yellow Choice1 Green choice15---->Yellow Choice6 Green choice11---->Yellow Choice4 Green choice11---->Yellow Choice2 Green choice16---->Yellow Choice7 Green choice8---->Yellow Choice8 Green choice10---->Yellow Choice3 Green choice14---->Yellow Choice5 22.Click the Task button. 9 / 12
Slide 11: The safer , easier way to help you pass any IT exams. Answer: Green choice3---->Yellow Choice1 Green choice2---->Yellow Choice2 Green choice1---->Yellow Choice3 Green choice1---->Yellow Choice4 23.Given: 1. public class Drink implements Comparable { 2. public String name; 3. public int compareTo(Object o) { 4. return 0; 5. } 6. } and: 20. Drink one = new Drink(); 21. Drink two = new Drink(); 22. one.name= "Coffee"; 23. two.name= "Tea"; 24. TreeSet set = new TreeSet(); 25. set.add(one); 26. set.add(two); A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result? A.Tea B.Coffee C.Coffee Tea D.Compilation fails. E.The code runs with no output. F.An exception is thrown at runtime. Answer:B 24.Given: 11. // insert code here 12. private N min, max; 13. public N getMin() { return min; } 14. public N getMax() { return max; } 15. public void add(N added) { 16. if (min == null || added.doubleValue() < min.doubleValue()) 17. min = added; 18. if (max == null || added.doubleValue() > max.doubleValue()) 19. max = added; 20. } 21. } Which two, inserted at line 11, will allow the code to compile? (Choose two.) A.public class MinMax { 10 / 12
Slide 12: The safer , easier way to help you pass any IT exams. B.public class MinMax { C.public class MinMax { D.public class MinMax { E.public class MinMax { F.public class MinMax { Answer:D F 25.Given: enum Example { ONE, TWO, THREE } Which statement is true? A.The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true. B.The expression (ONE < TWO) is guaranteed to be true and ONE.compareTo(TWO) is guaranteed to be less than one. C.The Example values cannot be used in a raw java.util.HashMap; instead, the programmer must use a java.util.EnumMap. D.The Example values can be used in a java.util.SortedSet, but the set will NOT be sorted because enumerated types do NOT implement java.lang.Comparable. Answer:A 26.Given: 1. import java.util.*; 2. public class Example { 3. public static void main(String[] args) { 4. // insert code here 5. set.add(new Integer(2)); 6. set.add(new Integer(1)); 7. System.out.println(set); 8. } 9. } Which code, inserted at line 4, guarantees that this program will output [1, 2]? A.Set set = new TreeSet(); B.Set set = new HashSet(); C.Set set = new SortedSet(); D.List set = new SortedList(); E.Set set = new LinkedHashSet(); Answer:A 27.Click the Task button. Answer: Green choice1---->Yellow Choice1 Green choice5---->Yellow Choice2 11 / 12
Slide 13: The safer , easier way to help you pass any IT exams. Green choice3---->Yellow Choice3 Green choice5---->Yellow Choice4 Green choice5---->Yellow Choice5 28.Given: 11. public class Key { 12. private long id1; 13. private long id2; 14. 15. // class Key methods 16. } A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works Answerly as a key? (Choose two.) A.public int hashCode() B.public boolean equals(Key k) C.public int compareTo(Object o) D.public boolean equals(Object o) E.public boolean compareTo(Key k) Answer:A D 29.Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("\s"); 13. System.out.println(tokens.length); What is the result? A.0 B.1 C.4 D.Compilation fails. E.An exception is thrown at runtime. Answer:D 30.Given: 12. public class Wow { 13. public static void go(short n) {System.out.print("short ");} 14. public static void go(Short n) {System.out.print("SHORT ");} 15. public static void go(Long n) {System.out.print(" LONG ");} 16. public static void main(String [] args) { 17. Short y = 6; 18. int z = 7; 19. go(y); 20. go(z); 21. } 22. } What is the result? A.short LONG B.SHORT LONG C.Compilation fails. D.An exception is thrown at runtime. Answer:C 12 / 12

   
Time on Slide Time on Plick
Slides per Visit Slide Views Views by Location