Mocks

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Mocks as PDF for free.

More details

  • Words: 1,070
  • Pages: 6
om na ta g. c Sun 310-081

w

w

w

.c

hi

Sun Certified Web Component Developer for the Java 2 Platform, Enterprise Edition 1.4

Q&A DEMO Version

Copyright (c) 2003 Chinatag LLC. All rights reserved.

Important Note Please Read Carefully For demonstration purpose only, this free version Chinatag study guide contains 10 full length questions selected from our full version products which have more than 200 questions each. This Study guide has been carefully written and compiled by Chinatag certification experts. It is designed to help you learn the concepts behind the questions rather than be a strict memorization tool. Repeated readings will increase your comprehension.

om

For promotion purposes, all PDF files are not encrypted. Feel free to distribute copies among your friends and let them know Chinatag website. Our IT certification products start at only $7.99.

na ta g. c

Study Tips

This product will provide you questions and answers along with detailed explanations carefully compiled and written by our experts. Try to understand the concepts behind the questions instead of cramming the questions. Go through the entire document at least twice so that you make sure that you are not missing anything.

Latest Version

hi

We are constantly reviewing our products. New material is added and old material is revised. Free updates are available for 180 days after the purchase. You should check the products page on the http://www.chinatag.com website for an update 3-4 days before the scheduled exam date.

w

.c

Please tell us what you think of our products. We appreciate both positive and critical comments as your feedback helps us improve future versions. Feedback on specific questions should be send to [email protected].

w

Good studying!

w

Thanks for purchasing our products and look forward to supplying you with all your Certification training needs.

Technical and Support Team Chinatag LLC.

310 -081

QUESTION NO: 1 Given: AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. An Adapterl 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.) A. AnAdapter1 aa = new AnAdapter1 () {} B. AnAdapter0 aa = new AnAdapter0 () {} C. AnAdapter0 aa = new AnAdapter0 (5) {} D. AnAdapter1 aa = new AnAdapter1 (5) {} E. AnInterface ai = new Anlnterface (5)) { Answer: BD

QUESTION NO: 2 1. class A { 3. public String to String() { 4. return “4”; 5. } 6. } 7. class B extends A { 8. public String toString() { 9. return super.toString() + “3”; 10. } 11. } 12. public class Test { 13. public static void main (String[] args) { 14. System.out.printIn(new B()); 15. } 16. } What is the result? A. Compilation succeeds and 4 is printed. B. Compilation …………… is printed. C. An error on line 9 cause compilation to fail. D. An error on line 14 cause compilation to fail. E. Compilation succeeds but an exception is thrown at line 9. Leading the way in©IT testing and certification tools, www.testking.com WWW.REAL-EXAMS.NET -3-

3

310 -081

Answer: B

QUESTION NO: 3 Given: 1. public class Method Over { 2. public void set Var (int a, int b, float c) { 3. } 4. } Which two overload the set Var method? (Choose two.) A. private void set Var(int a, float c, int b) {} B. protected void set Var(int a, int b, float c) {} C. public int set Var(int a, float c, int b) {return a:} D. public int set Var(int a, int b, float c) {return a:} E. protected float set Var(int a, int b, float c) {return c:} Answer: AC

QUESTION NO: 4 1. class A { 2. public byte file Number () { 3. return l; 4. } 5. } 6. 7. Class B extends A { 8. public short getNumber() { 9. return 2; 10. } 11. 12. public short getNumber() { 13. B b = new B(); 14. System.out.printIn(b.getNumber()); 15. } 16. } What is the result? Leading the way in©IT testing and certification tools, www.testking.com WWW.REAL-EXAMS.NET -4-

4

310 -081

A. Compilation succeeds and l is printed. B. Compilation succeeds and 2 printed. C. An error at line 8 cause compilation to fail. D. An error at line 14 cause complication to fail. E. Complication succeeds but an exception is thrown at line 14. Answer: C

QUESTION NO: 5 Given: 1. public class Foo { 2. public static void main(String[] args) { 3. StringBuffer a = new StringBuffer(“A”); 4. StrinbBuffer b = new StringBuffer(“B”); 5. operate (a, b); 6. System.out.printIn(a + “,” + b): 7. } 8. static void operate (StringBuffer x, StringBuffer y) { 9. y.append(x); 10. y = x; 11. } 12. } What is the result? A. The code compiles and prints “A,B”. B. The code compiles and prints “A,BA”. C. The code compiles and prints “AB,B”. D. The code compiles and prints “AB,AB”. E. The code compiles and prints “BA,BA”. F. The code does not compile because “+” cannot be overloaded for StringBuffer. Answer: B

QUESTION NO: 6 1. public class X { 2. private static int a: 3. Leading the way in©IT testing and certification tools, www.testking.com WWW.REAL-EXAMS.NET -5-

5

310 -081 4. public static void main (String [] args) { 5. modify (a) : 6. System.out.printIn(a) { 7. } 8. 9. public static void modify (int a) { 10. a++; 11. } 12. } What is the result? A. The program runs and prints “0” B. The program runs and prints “1” C. The program runs but aborts with an exception. D. An error “possible undefined variable” at line 5 cause compilation to fail. E. An error “possible undefined variable” at line 10 cause compilation to fail. Answer: A

QUESTION NO: 7 1. public class Test { 2. private static int j = 0; 3. 4. public static Boolean method B (int k) { 5. j + = k; 6. return true: 7. } 8. 9. public static void method A (int i) { 10. Boolean b; 11. b = I < 10 | method b (4): 12. b = I < 10 || methodb(8): 13. } 14. 15. public static void main (String args []) { 16. method A (0); 17. System.out.printIn(i); 18. } 19. } What is the result? Leading the way in©IT testing and certification tools, www.testking.com WWW.REAL-EXAMS.NET -6-

6

Related Documents