1Z0-850 | how many questions of 1Z0-850 dumps?


Q101. - (Topic 2) 

Which statement about java.util is incorrect? 

A. It contains the collections framework. 

B. It contains classes necessary to implement networking applications. 

C. It contains HashSet and Vector. 

D. It contains classes used to manipulate dates. 

Answer:

Q102. - (Topic 2) 

You are asked to create a Dog class that exposes the Dog class String name and int breed to other code as read-only attributes, provides encapsulation, and adheres to the standard JavaBeans naming conventions. 

Which approach implements these requirements? 

A. Provide public name() and public breed() methods in the Dog class, and mark the name and breed instance variables private. 

B. Provide private getName() and private getBreed() methods in the Dog class, and mark the name and breed instance variables private. 

C. Provide public getName() and public getBreed() methods in the Dog class, and mark the name and breed instance variables private. 

D. Provide private name() and private breed() methods in the Dog class, and mark the name and breed instance variables public. 

E. Provide public getName()/setName() and public getBreed()/setBreed() methods in the Dog class, and mark the name and breed instance variables private. 

Answer:

Q103. - (Topic 2) 

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 local variable invokeCount inside the go() method, and increment the variable within the go() method. 

B. Declare a static variable invokeCount for the class Foo, and increment the variable within the go() method. 

C. Declare a method parameter invokeCount as the argument to the go() method, and increment the variable within the go() method. 

D. Declare an instance variable invokeCount for the class Foo, and increment the variable within the go() method. 

Answer:

Q104. - (Topic 2) 

A developer must implement a "shopping cart" object for a web-based application. The shopping cart must be able to maintain the state of the cart, but the state is not stored persistently. Which J2EE technology is suited to this goal? 

A. JAX-RPC 

B. entity beans 

C. stateful session beans 

D. stateless session beans 

E. JMS 

Answer:

Q105. - (Topic 2) 

Which two are true? (Choose two.) 

A. SQL technology is used to access JMS queues from within EJB technology. 

B. SQL commands can be written in applications that use NO Java technologies. 

C. SQL allows you to modify multiple rows in a table with a single command. 

D. SQL is a web services technology used to parse large XML files. 

E. SQL commands cannot be contained in servlets. 

Answer: B,C 

Q106. - (Topic 2) 

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. !(n1 < n3) && (n5 != n4) 

B. (!b) && (n1 <= n4) 

C. (n2 > n6) || b 

D. (n2 < n6) && (n4 >= n1) 

E. (n3 < n5) || (n2 <= n1) 

Answer: A,C,E 

Q107. - (Topic 1) 

Given: 

1.

 class Book { 

2.

 public String title; 

3. 

4.

 public void setTitle(String title) { 

5.

 if (checkTitle(title)) this.title = title; 

6.

 } 

7.

 public String getTitle() { 

8.

 return title; 

9.

 } 

10.

 private boolean checkTitle(String newTitle) { 

11.

 // code that verifies proposed title change 

12.

 } 

13.

 } 

Which two are true? (Choose two.) 

A. The title attribute is protected from direct modification by outside code. 

B. The Book class demonstrates encapsulation. 

C. The Book class does NOT provide information hiding. 

D. The Book class adheres to the JavaBeans naming conventions. 

E. The checkTitle method can be accessed from outside the Book class. 

Answer: C,D 

Q108. - (Topic 2) 

Which two describe benefits of encapsulation? (Choose two.) 

A. Code is more flexible because the attributes can be modified directly from code in other packages. 

B. Code is more reusable because the attributes of the class are protected from direct modification by other code. 

C. Code is safer because attributes of the class CANNOT be directly modified by code outside the class. 

D. Code is more useful because attributes of the class can be accessed by other classes for both reading and writing. 

E. Code is more efficient because attributes of the class can be accessed directly by other classes, without the overhead of going through access methods. 

Answer: B,C 

Q109. - (Topic 2) 

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. Compilation fails because of an error at line 7. 

B. str : Hello! 

C. str : How are you doing? 

D. Compilation fails because of an error at line 2. 

E. Compilation fails because of an error at line 3. 

F. str : Hello! How are you doing? 

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

Answer:

Q110. - (Topic 1) 

Given: 

interface Writable { } 

interface Erasable { } 

Which three are valid? (Choose three.) 

A. public class Pencil implements Erasable,Writable { /*...*/ } 

B. public interface Pencil extends Writable { /*...*/ } 

C. public interface Pencil implements Writable { /*...*/ } 

D. public class Pencil implements Writable { /*...*/ } 

E. public class Pencil extends Writable { /*...*/ } 

Answer: A,B,D