Many new exams are available at Exampdf.com, such
as SY0-301, E22-275, 000-118, and so on. With
Exampdf real Q&As of any IT certification exam, all the
examinees can clear the exams easily. Take charge of
your time now.
The safer , easier way to help you pass any IT exams.
Exam : 1Z0-850
Title
:
J
a
v
a Standard Edition 5 and
6, Certified Associate Exam
Version : Demo
1 / 7
The safer , easier way to help you pass any IT exams.
1.Which two are true? (Choose two.)
A. J2EE runs on consumer and embedded devices.
B. J2EE includes the MIDP API.
C. J2EE includes servlet APIs and EJB APIs.
D. J2EE application developers need J2SE.
E. J2EE applications depend on web servers.
Answer: C,D
2.Which two are associated with the web tier in a J2EE web-based application.? (Choose two.)
A. servlets
B. JAX-RPC
C. JMS
D. entity beans
E. JSP
Answer: A,E
3.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. static int calc(int n1, int n2) { return; }
B. public int calc(int n1, int n2) { return n1 + n2; }
C. public int calc(int n1, int n2) { return; }
D. static int calc(int n1, int n2) { return n1 + n2; }
E. static void calc(n1, n2) { return (n1 + n2); }
F. static int calc(int n1, n2) { return n1, n2; };
Answer: D
4.Given:
1. public abstract class Wow {
2. private int wow;
3. public Wow(int wow) {
4. this.wow = wow;
5. }
6. public void wow() { }
7. private void wowza() { }
8. }
2 / 7
The safer , easier way to help you pass any IT exams.
Which is true about the class Wow?
A. It does NOT compile because an abstract class must have at least one abstract method.
B. It does NOT compile because an abstract class CANNOT have instance variables.
C. It compiles without error.
D. It does NOT compile because an abstract class CANNOT have private methods.
E. It does NOT compile because an abstract class must have a constructor with no arguments.
Answer: C
5.Given:
1. class X {
2. private Y y;
3. public X(Y y) { this.y = y; }
4. }
5. class Y {
6. private X x;
7. public Y() { }
8. public Y(X x) { this.x = x; }
9. }
The instance variable y is intended to represent the composition relationship "X is composed of Y."
Which code correctly maintains this meaning?
A. X x1 = new X(new Y())
;
X x2 = new X(new Y())
;
B. X xx = new X(null)
;
Y y1 = new Y(xx)
;
Y y2 = new Y(xx)
;
C. Y yy = new Y()
;
X x1 = new X(yy)
;
X x2 = new X(yy)
;
D. Y y1 = new Y(new X(null))
;
Y y2 = new Y(new X(null))
;
Answer: A
6.Which type of J2EE component is used to store business data persistently?
A. stateless session beans
3 / 7
The safer , easier way to help you pass any IT exams.
B. JavaBeans
C. stateful session beans
D. entity beans
E. JavaServer Pages
Answer: D
7.What is the purpose of JNDI?
A. to access native code from a Java application
B. to parse XML documents
C. to access various directory services using a single interface
D. to register Java Web Start applications with a web server
Answer: C
8.Which two are true about HTML? (Choose two.)
A. HTML can set up hypertext links between documents.
B. HTML uses tags to structure text into headings, paragraphs, and lists.
C. HTML is an object-oriented programming language.
D. HTML documents CANNOT be browsed by a text editor.
Answer: A,B
9.Given:
4. class Example {
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. Compilation fails because of an error at line 8.
B. x = 3 , y = 7
C. Compilation fails because of an error at line 11.
D. Compilation fails because of an error at line 9.
E. x = 53 , y = 97
F. Compilation fails because of an error at line 10.
Answer: B
10.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?
4 / 7
The safer , easier way to help you pass any IT exams.
A. The MIDlet is 100% portable across all J2ME devices.
B. The MIDlet can run within a standard web browser.
C. The MIDlet is guaranteed to run correctly under J2SE.
D. The MIDlet is NOT guaranteed to run on a Java technology-enabled phone.
Answer: D
11.Which statement is true?
A. JMS enables an application to provide flexible, asynchronous data exchange.
B. JMS provides interfaces to naming and directory services.
C. The JMS API is located in the java.jms package.
D. JMS enables an application to provide tightly coupled, distributed communication.
Answer: A
12.Which two are true about stateless session beans? (Choose two.)
A. They are used to represent data stored in an RDBMS.
B. They implement the JMS API.
C. They are used to implement business logic.
D. They CANNOT hold client state.
Answer: C,D
13.Which two are true about javax.swing? (Choose two.)
A. It includes classes for creating buttons and panels.
B. It is used to create MIDlets.
C. It is used to create applications that have the same user interface on different platforms.
D. It uses the native GUI components of each platform.
Answer: A,C
14.Which two are true? (Choose two.)
A. An interface CANNOT be extended by another interface.
B. An abstract class CANNOT be extended by an abstract class.
C. An interface can be extended by an abstract class.
D. An abstract class can implement an interface.
E. An abstract class can be extended by a concrete class.
F. An abstract class can be extended by an interface.
Answer: D,E
15.Click the Exhibit button.
Which relationships, referenced by the class names involved, are drawn using valid UML notation?
5 / 7
The safer , easier way to help you pass any IT exams.
A. AB, AC, BD, and CD
B. only AC, BD, and CD
C. only AB, AC, and BD
D. only AB and AC
E. only BD and CD
Answer: A
16.Given:
12. String s = "abcdefgabc";
13. char c = s.charAt(2);
14.
15. if (c == 'c')
16. s = s.replace('c', 'X');
17. else if (c == 'b')
18. s = s.replace('b', 'O');
19. else
20. s = s.replace('c', 'O');
21. System.out.println(s);
What is the result?
A. aOcdefgabc
B. Compilation fails.
C. abOdefgabc
D. abXdefgabc
E. abOdefgabO
F. aOcdefgaOc
G. abXdefgabX
Answer: G
17.Which package contains classes used to create data collections, such as maps or queues?
A. java.lang
B. java.io
C. java.awt
D. java.net
E. javax.swing
F. java.util
6 / 7
The safer , easier way to help you pass any IT exams.
Answer: F
18.Given:
1. interface A { }
2. interface B { void b(); }
3. interface C { public void c(); }
4. abstract class D implements A,B,C { }
5. class E extends D {
6. void b() { }
7. public void c() { }
8. }
Which is true?
A. Compilation fails due to an error in line 6.
B. The code compiles without error.
C. Compilation fails due to an error in line 2.
D. Compilation fails due to an error in line 4.
E. Compilation fails due to an error in line 1.
Answer: A
19.What type of relationship is needed to represent the relationship between students and the courses
they are enrolled in at a university?
A. a one-to-one composition
B. a one-to-one association
C. a many-to-many composition
D. a one-to-many composition
E. a one-to-many association
F. a many-to-many association
Answer: F
20.Which two are features of JNDI? (Choose two.)
A. an interface to store and retrieve named Java objects of any type
B. an interface to search for objects using attributes
C. a defined common set of messaging concepts and programming strategies
D. connectivity to databases and other tabular data sources
Answer: A,B
7 / 7
Add New Comment