QUESTION 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: CD
QUESTION 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: AE
QUESTION 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
QUESTION 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. }
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
QUESTION 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
QUESTION 6
Which type of J2EE component is used to store business data persistently?
A. stateless session beans
B. JavaBeans
C. stateful session beans
D. entity beans
E. JavaServer Pages
Answer: D
QUESTION 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
QUESTION 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: AB
QUESTION 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
QUESTION 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?
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
QUESTION 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
QUESTION 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: CD
QUESTION 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: AC
QUESTION 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: DE
QUESTION 15
Click the Exhibit button. Which relationships, referenced by the class names involved, are drawn using valid UML notation?
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
QUESTION 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
QUESTION 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
Answer: F
QUESTION 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
QUESTION 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
QUESTION 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: AB
Passing your Oracle 1Z0-850 Exam by using the latest 1Z0-850 Exam Dump Full Version: http://www.braindump2go.com/1z0-850.html