Вы находитесь на странице: 1из 25

Sun 310-019 Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.

0 242 Q&A

Looking for Real Exam Questions for IT Certification Exams! We guarantee you can pass any IT certification exam at your first attempt with just 10-12 hours study of our guides. Our study guides contain actual exam questions, you will get word to word same on your actual test; accurate answers with detailed explanation verified by experts and all graphics and drag-n-drop exhibits shown just as on the real test. To test the quality of our guides, you can download the one-third portion of any guide from http://www.certificationking.com absolutely free. Besides, we also offer complete version of following exams absolutely free. You can start your certification from these free guides and if you are satisfied you can buy the rest
Microsoft: 70-270, 70-305 Cisco: 642-901 Oracle: 1Z0-007, 200 CompTIA: 220-601 SUN: 310-011, 310-043 Citrix: 1Y0-A01, 1Y0-256 CIW: 1D0-420 Novell: 50-686 Adobe: 9A0-029 Apple: 9L0-005, 9L0-505 Avaya: 132-S-100 Cognos: COG-105 CWNP: PW0-100 EMC: E20-001 Hyperion: 4H0-002 HP: HP0-771, HP0-J24 IBM: 000-253, 000-700 Juniper: JN0-100, JN0-201 Lotus: LOT-737 Nortel: 920-803 SAS: A00-201 SNIA: S10-100 Sybase: 510-015 Symantec: 250-101 TeraData: NR0-011

For pricing and placing order, please visit http://certificationking.com/order.html We accept all major credit cards through www.paypal.com For other payment options and any further query, feel free to mail us at info@certificationking.com

Q: 1 Which three about JMS are true? (Choose three.)

A. JMS is the acronym for Java Mail Service. B. JMS supports an event-oriented approach to message reception. C. JMS supports both synchronous and asynchronous message passing.
D. JMS does NOT depend on MOM (Messaging-Oriented Middleware) products.

E. JMS provides a common way for Java programs to access an enterprise messaging system's messages. Answer: B, C, E Q: 2 Which statement is true? A. B. C. D. The JMS API is located in the java.jms package. JMS provides interfaces to naming and directory services. JMS enables an application to provide flexible, asynchronous data exchange. JMS enables an application to provide tightly coupled, distributed communication.

Answer: C Q: 3 A Java programmer wants to develop a small application to run on mobile phones. Which Java edition (or editions) are required to develop the application? A. B. C. D. E. F. only J2SE only J2EE only J2ME J2SE and J2EE J2SE and J2ME J2EE and J2ME

Answer: E Q: 4 Which is true? A. All JDBC drivers are pure Java. B. The JDBC API is included in J2SE. C. The JDBC API is an extension of the ODBC API. www.CertificationKing.com -3-

D. JDBC is used to connect to MOM (Message-Oriented Middleware) products.

Answer: B Q: 5 Which two are true? (Choose two.) A. B. C. D. E. J2EE includes the MIDP API. J2EE application developers need J2SE. J2EE includes servlet APIs and EJB APIs. J2EE applications depend on web servers. J2EE runs on consumer and embedded devices.

Answer: B, C Q: 6 Which is true? A. A J2SE program can create no more than 10 concurrent threads. B. The Java threading model provides equal processor time to all threads. C. All threads created by a given Java program share the same invocation stack. D. Threading allows GUI applications to perform lengthy calculations and respond to user events at the same time. Answer: D Q: 7 Which two are characteristics of an RDBMS? (Choose two.) A. B. C. D. E. J2EE provides a cross-platform RDBMS. An RDBMS represents data using two-dimensional tables. An RDBMS represents data using three-dimensional tables. Business-tier applications use session beans to represent rows in an RDBMS. Java technologies provide capabilities for connecting a legacy RDBMS to a web application.

Answer: B, E Q: 8 Which is true about RMI? A. RMI is used to create thin web clients. B. RMI allows objects to be sent from one computer to another. www.CertificationKing.com -4-

C. RMI is the Java API used for executing queries on a database. D. RMI is used to develop applications for wireless mobile devices. E. RMI is the transport protocol used by web servers and browsers. Answer: B Q: 9 What is the purpose of JNDI? A. B. C. D. to parse XML documents to access native code from a Java application to register Java Web Start applications with a web server to access various directory services using a single interface

Answer: D Q: 10 Which statement about threading in Java is false? A. B. C. D. A thread is a special type of method. The synchronized keyword is used to lock objects. A thread whose execution has completed is no longer runnable. Threads waiting to be executed are generally chosen for execution based on priority.

Answer: A Q: 11 What is the definition of the acronym SQL? A. B. C. D. E. F. Special Query Language System Query Language Special Queue Language System Queue Language Structured Query Language Structured Queue Language

Answer: E Q: 12 A Java programmer wants to develop a browser-based multitier application for a large bank. Which Java edition (or editions) should be used to develop this system?

www.CertificationKing.com -5-

A. only J2SE
B. only J2EE

C. only J2ME D. J2SE and J2EE E. J2SE and J2ME


F. J2EE and J2ME

Answer: D Q: 13 Which two are true? (Choose two.) A. B. C. D. E. SQL commands cannot be contained in servlets. SQL is a web services technology used to parse large XML files. SQL technology is used to access JMS queues from within EJB technology. SQL commands can be written in applications that use NO Java technologies. SQL allows you to modify multiple rows in a table with a single command.

Answer: D, E Q: 14 Click the Exhibit button. Which class correctly implements the interface Flyer?

www.CertificationKing.com -6-

A. B. C. D.

Lark Airplane Penguin Helicopter

Answer: B Q: 15 Click the Exhibit button. Which two are true? (Choose two.)

A. B. C. D. E.

The diagram shows a composition relation. The diagram does NOT show a composition relation. A Foo instance has access to the Bar with which it is associated. A Bar instance has access to the Foo with which it is associated. It cannot be determined from the diagram whether instances of Foo and Bar will have access to each other.

Answer: B, D Q: 16 Which two are valid representations of operations in UML? (Choose two.)

A. B. C. D. E.

- op(p : P) : P + int op(int param) * op(param : int) : int + op(param : int) : int public void op(int param)

Answer: A, D Q: 17 Click the Exhibit button. Which is an abstract class?

www.CertificationKing.com -7-

A. B. C. D.

Cat Dog Rabbit Mouse

Answer: D Q: 18 Click the Exhibit button. Which two are true? (Choose two.)

A. B. C. D. E. F.

It is valid for a Zippy to have no associated Dippy. It is valid for a Dippy to have no associated Zippy. Every Zippy must be associated with exactly one Dippy. Every Dippy must be associated with exactly one Zippy. Every Dippy must be associated with at least one Zippy. It is valid for a Zippy to be associated with more than one Dippy.

Answer: A, E Q: 19 Click the Exhibit button. Which is the class name?

www.CertificationKing.com -8-

A. B. C. D. E.

eat age Dog bark name

Answer: C Q: 20 Click the Exhibit button. Which two are true? (Choose two.)

A. B. C. D. E.

Every Flurb contains a reference to itself. Every Flurb is associated with exactly one Flurb. There can only be one instance of the Flurb class. There must always be an even number of Flurb instances. A Flurb can be associated with itself, but it also could be associated with a different Flurb.

Answer: B, E Q: 21 Click the Exhibit button. Which is true?

www.CertificationKing.com -9-

A. B. C. D. E.

Juku is a subclass of Hara. This is NOT a valid UML diagram. Juku implements the Hara interface. Every Juku has a reference to at least one Hara. Juku is a subclass of Hara and at least one other class.

Answer: B Q: 22 Which two are true? (Choose two.) A. 2..4 is a valid multiplicity indicator. B. The multiplicity indicators * and 1..* are equivalent. C. The multiplicity indicators + and 1..* are equivalent. D. An optional association is shown using the multiplicity indicator 0..1. E. Multiplicity indicators must always be shown at both ends of an association. F. Multiplicity indicators are optional, but if they are included they must be shown at both ends of an association. Answer: A, D Q: 23 Which two are represented in a UML class diagram? (Choose two.) A. B. C. D. ways to test an application operations of classes and interfaces relationships between classes and interfaces the interactions between objects in sequential order

www.CertificationKing.com - 10 -

Answer: B, C Q: 24 Which is true regarding multiplicity?

A. It is used to show the interfaces implemented by a class. B. It is used to indicate which class some other class extends. C. It is used to indicate of which class an object is an instance. D. It is used to indicate the number of instances of a class that may be associated with an instance of some other class. Answer: D Q: 25 Click the Exhibit button. Which is true about the use of italics in this diagram?

A. B. C. D. E.

The use of italics carries no standard UML meaning. The use of italics indicates that Blipvert is an interface. The use of italics indicates that Blipvert is a final class. The use of italics indicates that Blipvert is an enumeration. The use of italics indicates that Blipvert is an abstract class.

Answer: E Q: 26 Which type of GUI component is NOT included in Swing? A. B. C. D. Dialog Box Tree Table File Chooser Color Chooser www.CertificationKing.com - 11 -

Answer: B Q: 27 Which is a benefit of Swing clients? A. B. C. D. They are easier to deploy than thin clients. They can be used without a JRE on the client. They are more universally supported by browsers than thin clients. They can provide a richer graphical user interface experience than thin clients.

Answer: D Q: 28 Which two are true about JavaScript and HTML? (Choose two.) A. B. C. D. HTML is displayed in a client-side environment. JavaScript runs only in a server-side environment. JavaScript must be deployed in a separate file from HTML. JavaScript has a function that can open a new browser window.

Answer: A, D Q: 29 Which environment has the highest probability of properly supporting an applet? A. B. C. D. J2EE server environment mobile environments using telephone handsets intranet environment where client components are standardized Internet environment where client components are not standardized

Answer: C Q: 30 Which two are true about JavaScript and HTML? (Choose two.) A. B. C. D. E. JavaScript is part of the J2SE. JavaScript and HTML are NOT compiled. JavaScript provides more client-side functionality than HTML alone. JavaScript code is always processed on the server, NOT on the client. JavaScript is guaranteed to be portable across all browsers on any platform. www.CertificationKing.com - 12 -

Answer: B, C Q: 31 Which two are true about HTML? (Choose two.) A. B. C. D. HTML is an object-oriented programming language. HTML documents CANNOT be browsed by a text editor. HTML can set up hypertext links between documents. HTML uses tags to structure text into headings, paragraphs, and lists.

Answer: C, D Q: 32 Which is a requirement to use applets in a web browser? A. B. C. D. A web container must be installed at the server. The Java Plug-in must be installed on the server. The Java compiler must be installed on the client. The Java Runtime Environment must be installed on the client.

Answer: D Q: 33 You have developed a MIDlet that runs on a Java-enabled Personal Digital Assistant (PDA) device. Now, your employer has asked you to port the MIDlet to run on other Java platforms. Which is true? A. B. C. D. The MIDlet can run within a standard web browser. The MIDlet is guaranteed to run correctly under J2SE. The MIDlet is 100% portable across all J2ME devices. The MIDlet is NOT guaranteed to run on a Java technology-enabled phone.

Answer: D Q: 34 Which two are true about the Swing API? (Choose two.) A. B. C. D. Swing can be used without AWT. Swing provides more GUI components than AWT. Swing is considered more "lightweight" than AWT. Swing classes are located in the java.awt package. www.CertificationKing.com - 13 -

Answer: B, C Q: 35 Which two are true? (Choose two.) A. B. C. D. MIDP does NOT have an API to support audio. MIDP does NOT have an API to support text messaging. A MIDP device must support wireless downloading of software. J2ME can be used to make network-connected household appliances.

Answer: C, D Q: 36 Which is an advantage of applets over HTML/JavaScript clients? A. B. C. D. Applets are more widely supported by browsers. Applets are downloaded more quickly to the client. Applets can use a wider variety of UI components. In their default state, applets have access to the client's computer.

Answer: C Q: 37 Which two are true about HTML? (Choose two.) A. B. C. D. It can be generated dynamically by servlets. It is an object-oriented programming language. It is used by the browser to display the client user interface. It contains APIs that are used to access data in an RDBMS.

Answer: A, C Q: 38 Which is true? A. B. C. D. Any J2ME application can be run on any J2ME device. Only a single J2ME configuration, CLDC, has been created. J2ME can be customized using profiles to add functionality to specific devices. J2ME applications can run on mobile devices without a J2ME runtime environment.

www.CertificationKing.com - 14 -

Answer: C Q: 39 Given: 1. class Test2 { 2. static String setMessage(String str) { 3. return str + "How are you doing?"; 4. } 5. 6. public static void main(String[] args) { 7. String str = "Hello! "; 8. str = setMessage(str); 9. System.out.println("str : " + str); 10. } 11. } What is the result? A. B. C. D. E. F. str : Hello! str : How are you doing? str : Hello! How are you doing? Compilation fails because of an error at line 2. Compilation fails because of an error at line 3. Compilation fails because of an error at line 7.

G. Compilation fails because of an error at line 8.

Answer: C Q: 40 Given: 6. int time = 12; 7. if ( time < 12 ) { 8. System.out.println("Good morning"); 9. } 10. // insert code here 11. System.out.println("Good afternoon"); 12. } 13. else if ( time >= 18 ) { 14. System.out.println("Good evening"); 15. } Which three, inserted independently at line 10, produce the output Good afternoon? (Choose three.) A. if ( time >= 12 && time < 18 ) { B. else if ( time < 12 || time > 18) { www.CertificationKing.com - 15 -

C. else if ( time > 12 || time <= 18 ) { D. else if ( time > 12 && time >= 18 ) { E. else if ( time >= 12 || time < 18 ) { Answer: A, C, E Q: 41 Given: 11. class Cat { 14. public static void main(String [] args) { 15. Cat c1 = new Cat(); 16. Cat c3 = new Cat(); 17. Cat c2 = c1; 18. Cat c4 = c3; 19. c1 = c4; 20. c4 = c2; 21. if (c1 == c2) System.out.print("c1 == c2 ");
22. if (c1 == c3) System.out.print("c1 == c3 ");

23. } 24. } What is the result? A. B. C. D. E. c1 == c2 c1 == c3 c1 == c2 c1 == c3 No output is produced. The output is unpredictable.

Answer: B Q: 42 You need to create a class Foo that will record the number of times the go() method is invoked on a particular instance of the class. Which solution correctly implements this goal?
A. Declare a static variable invokeCount for the class Foo, and increment the variable within the go() method.

B. Declare an instance variable invokeCount for the class Foo, and increment the variable within the go() method. C. Declare a local variable invokeCount inside the go() method, and increment the variable within the go() method. D. Declare a method parameter invokeCount as the argument to the go() method, and increment the variable within the go() method.

www.CertificationKing.com - 16 -

Answer: B Q: 43 Given: 4. int n1 = 22, n2 = 67, n3 = 0, n4 = 47, n5 = 17, n6 = 50; 5. boolean b = true; Which three evaluate to true? (Choose three.) A. B. C. D. E. (n2 > n6) || b (!b) && (n1 <= n4) (n2 < n6) && (n4 >= n1) (n3 < n5) || (n2 <= n1) !(n1 < n3) && (n5 != n4)

Answer: A, D, E Q: 44 Given: 3. int num = 0, count; 4. while ( num < 3 ) { 5. num++; 6. // insert code here 7. System.out.println("num = " + num + " : count = " + count); 8. } 9. } Which, inserted at line 6, produces the following output? num = 1 : count = 1 num = 1 : count = 2 num = 2 : count = 1 num = 2 : count = 2 num = 3 : count = 1 num = 3 : count = 2 A. B. C. D. E. while ( ++count < 3 ) { while ( ++count < 2 ) { for ( count = 1 ; count < 3 ; count++ ) { for ( count = 0 ; count < 3 ; count++ ) { for ( count = 1 ; count < 2 ; count++ ) {

Answer: C

www.CertificationKing.com - 17 -

Q: 45 Given: 1. class Test { 2. public static void main(String args[]) { 3. int i = 1; 4. while (i-- > 1) { 5. System.out.println("i : " + i); 6. } 7. } 8. } What is the result? A. B. C. D. E. i:1 i:0 i : -1 No output is produced. Compilation fails.

Answer: D Q: 46 Given: 1. class Test {


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

3. int num; 4. num = 10; 5. calc(num); 6. System.out.println("num = " + num); 7. } 8. 9. static void calc(int num) { 1 0. num += 100; 11. } 12. } What is the result? A. B. C. D. E. num = 10 num = 110 num = 100 Compilation fails because of an error at line 3. Compilation fails because of an error at line 9.

Answer: A

www.CertificationKing.com - 18 -

Q: 47 Given: 1. class Test { 2. public static void main(String args[]) { 3. int num1 = 10, num2 = 20, result; 4. result = calc(num1, num2); 5. System.out.println(result); 6. } 7. 8. // insert code here 9. } Which, inserted at line 8, produces the output 30? A. B. C. D. E. F. static int calc(int n1, int n2) { return; } public int calc(int n1, int n2) { return; } static void calc(n1, n2) { return (n1 + n2); } static int calc(int n1, n2) { return n1, n2; }; static int calc(int n1, int n2) { return n1 + n2; } public int calc(int n1, int n2) { return n1 + n2; }

Answer: E Q: 48 Given: 1. class Test { 2. public static void main(String args[]) { 3. String str = new String("Welcome"); 4. // insert code here 5. } 6. } Which, inserted at line 4, produces the output true? A. B. C. D. E. System.out.println(str.trim()); System.out.println(str.indexOf(1)); System.out.println(str.indexOf("W")); System.out.println(str.startsWith("W")); System.out.println(str.startsWith('W'));

Answer: D Q: 49 Given: 4. class Example { www.CertificationKing.com - 19 -

5. int x = 50; 6. int y = 100; 7. public static void main(String args[]) { 8. int x = 0, y = 10; 9. Example ex = new Example(); 10. while (x < 3) { 11. x++; y--; 12. } 13. System.out.println("x = " + x + " , y = " + y); 14. } 15. } What is the result? A. B. C. D. E. F. x=3,y=7 x = 53 , y = 97 Compilation fails because of an error at line 8. Compilation fails because of an error at line 9. Compilation fails because of an error at line 10. Compilation fails because of an error at line 11.

Answer: A Q: 50 You need an algorithm that must: .Iterate through an array of primitive integers .Print the value of each array element in index order If the value of the element is equal to 10, print the value of the element, and then terminate the iteration Which method correctly implements the algorithm? A. public static void foo(int[] list) { for(int i:list) { System.out.println(i); if (i==10) break; } B. public static void foo(int[] list) { while(list.length > 0) { System.out.println(i); if (i==10) break; } C. public static void foo(int[] list) { for each(int i in list) { www.CertificationKing.com - 20 -

System.out.println(i); if (i==10) terminate; } D. public static void foo(int[] list) { for(int i=0; i < list.length; i++) { System.out.println(i); if (i==10) break; } E. public static void foo(int[] list) { for(int i=0; i < list.length; i++) { System.out.println(i); if (i==10) continue; } Answer: A Q: 51 Given: 2. class Test { 3. public static void main(String args[]) { 4. for (int i = 1; i < 5; i++) { 5. if (i == 2) { 6. continue; 7. } 8. System.out.print(" i = " + i); 9. } 10. } 11. } What is the result? A. B. C. D. E. F. G. i=1 Compilation fails. i=1 i=3 i=4 i=1 i=2 i=4 The code runs with no output. i=1 i=3 i=4 i=5 i=1 i=2 i=4 i=5

Answer: C Q: 52 Given: 18. String s = " abcdcba "; 19. int x = 2; www.CertificationKing.com - 21 -

20. s = s.trim(); 21. if (s.length() < 8) { 22. x = s.indexOf('c', 3); 23. } 24. System.out.println("x = " + x); What is the result? A. B. C. D. E. x=2 x=3 x=4 x=5 x=6

Answer: C Q: 53 Given: 1. class Test { 2. public static void main(String[] args) { 3. int num = 1; 4. for (num = 0; num < 3; ++num ) { 5. num *= 2; 6. } 7. System.out.println("num = " + (num++)); 8. } 9. } What is the result? A. B. C. D. E. num = 5 num = 4 num = 3 num = 2 Compilation fails.

Answer: C Q: 54 Given: 1. class Test { 2. public static void main(String[] args) { 3. String str = "Hello"; 4. str = str.replace("Bye"); www.CertificationKing.com - 22 -

5. System.out.println("str : " + str); 6. } 7. } What is the result? A. B. C. D. E. F. G. str : Bye str : Byelo str : HeBye str : Hello Compilation fails. str : HelloBye The code runs with no output.

Answer: E Q: 55 Given: 1. public class Bar { 2. int size; 3. public static void main(String[] args) { 4. Bar b = new Bar(); 5. b.size = 27; 6. int i = b.go(b.size); 7. System.out.print(b.size + " : " + i); 8. } 9. public int go(int size) { 10. size++; 11. return size; 12. } 13. } What is the result?

A. B. C. D. E.

27 : 27 28 : 27 27 : 28 28 : 28 Compilation fails.

Answer: C Q: 56 Given: www.CertificationKing.com - 23 -

1. class Test { 2. public static void main(String args[]) { 3. String str = "Hello!"; 4. String str2 = "Bye!"; 5. str += str2; 6. str -= str2; 7. 8. if ( str == str2 ) { 9. System.out.println("str = str2");
10. } else {

11. System.out.println("str != str2"); 12. } 13. } 14. } What is the result? A. B. C. D. str = str2 str != str2 Compilation fails. The code runs with no output.

Answer: C Q: 57 Which is an appropriate description of session beans? A. B. C. D. They are used to store persistent data. They are used to share data among clients. They are used to represent data in an RDBMS. They are used to implement business processes.

Answer: D Q: 58 Which technology is used to develop components that interact with server-side objects in a web-based application? A. B. C. D. XML HTML servlets JavaScript

www.CertificationKing.com - 24 -

Answer: C Q: 59 Which three are provided by the EJB tier in a multitier J2EE application? (Choose three.) A. B. C. D. E. security XML parsing concurrency control transaction management dynamic content generation

Answer: A, C, D Q: 60 Which two are NOT Enterprise Beans? (Choose two.) A. B. C. D. E. JavaBeans entity beans session beans business beans message-driven beans

Answer: A, D Q: 61 Which J2EE technology is used to generate dynamic content for web-based applications? A. B. C. D. E. JMS JSP JNDI SOAP JAX-RPC

Answer: B Q: 62 Which is NOT a correct statement about entity beans? A. They are used to store persistent data. B. They are persisted using BMP and CMP. www.CertificationKing.com - 25 -

Вам также может понравиться