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


Q51. - (Topic 2) 

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. num = 2 

B. num = 4 

C. num = 3 

D. num = 5 

E. Compilation fails. 

Answer:

Q52. - (Topic 2) 

Which technology is used to develop components that interact with server-side objects in a web-based application? 

A. XML 

B. servlets 

C. HTML 

D. JavaScript 

Answer:

Q53. - (Topic 2) 

Which statement about threading in Java is false? 

A. Threads waiting to be executed are generally chosen for execution based on priority. 

B. The synchronized keyword is used to lock objects. 

C. A thread is a special type of method. 

D. A thread whose execution has completed is no longer runnable. 

Answer:

Q54. - (Topic 2) 

Which three are true? (Choose three.) 

A. All methods in an abstract class must be abstract. 

B. If concrete class C extends concrete class B, and B implements interface A, then all methods from interface A can be invoked on an instance of 

C. An abstract class CANNOT be instantiated. 

D. If abstract class B directly extends abstract class A, class B must implement all abstract methods declared in A. 

E. An interface can extend multiple interfaces. 

Answer: B,C,E 

Q55. - (Topic 2) 

Given: 

1.

 interface Movable { 

2.

 void move(); 

3.

 void stop(); 

4.

 } 

Which is valid? 

A. public class Bicycle implements Movable { 

public void move() { /*...*/ } 

public void stop() { /*...*/ } 

B. public class Bicycle implements Movable { 

void move() { /*...*/ } 

void stop() { /*...*/ } 

C. public class Bicycle extends Movable { 

public void move() { /*...*/ } 

public void stop() { /*...*/ } 

D. public class Bicycle implements Movable { 

public void move() { /*...*/ } 

Answer:

Q56. - (Topic 2) 

Given two complete source files: 

1.

 /* Example.java */ 

2.

 package pack; 

3.

 public class Example { } 

1.

 /* Test.java */ 

2.

 // insert code here 

3.

 public class Test { 

4.

 public static void main(String args[]) { 

5.

 Example obj = new Example(); 

6.

 } 

7.

 } 

Which, inserted at line 2 in Test.java, allows the code to compile? 

A. import pack; 

B. The code compiles with no changes. 

C. import pack.Test; 

D. import pack.Example; 

Answer:

Q57. - (Topic 1) 

Click the Exhibit button. 

Which two are true? (Choose two.) 

A. A Flux knows with which Grok it is associated. 

B. A Grok knows with which Flux it is associated. 

C. Deleting a Grok will cause a Plu to be deleted. 

D. Deleting a Plu will cause a Grok to be deleted. 

E. Deleting a Snip will cause its associated Grok to be deleted. 

F. Any Grok associated with a Flux must be deleted when the Flux is deleted. 

Answer: A,C 

Q58. - (Topic 1) 

Which two are valid? (Choose two.) 

A. class EnumTest { 

public static void main(String args[]) { 

enum Num { ONE, TWO, THREE, FOUR } 

System.out.println(Num.ONE); 

B. class EnumTest { 

enum Days { Sat, Sun, Mon, Tue, Wed, Thu, Fri } 

public static void main(String args[]) { 

System.out.println(Days.Sat); 

C. class EnumTest { 

enum Colors { Red = 1, Green = 2, Blue = 4, Yellow = 8 } 

public static void main(String args[]) { 

System.out.println(Colors.Red); 

D. enum Suit { CLUBS, DIAMONDS, HEARTS, SPADES } 

class EnumTest { 

public static void main(String args[]) { 

System.out.println(Suit.CLUBS); 

Answer: B,D 

Q59. - (Topic 1) 

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. only J2ME 

B. J2SE and J2EE 

C. only J2EE 

D. J2SE and J2ME 

E. only J2SE 

F. J2EE and J2ME 

Answer:

Q60. - (Topic 2) 

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 each(int i in list) { System.out.println(i); 

if (i==10) terminate; } 

B. public static void foo(int[] list) { 

for(int i=0; i < list.length; i++) { 

System.out.println(i); 

if (i==10) continue; 

C. public static void foo(int[] list) { 

for(int i:list) { 

System.out.println(i); 

if (i==10) break; 

D. public static void foo(int[] list) { 

while(list.length > 0) { 

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) break; 

Answer: