[Free] 2018(Jan) EnsurePass Dumpsleader Oracle 1z0-850 Dumps with VCE and PDF 141-150

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-850
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-850.html

Java Standard Edition 5 and 6, Certified Associate Exam

Question No: 141 – (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?

  1. public static void foo(int[] list) { for each(int i in list) { System.out.println(i);

    if (i==10) terminate;

    }

  2. public static void foo(int[] list) { for(int i=0; i lt; list.length; i ) { System.out.println(i);

    if (i==10) continue;

    }

  3. public static void foo(int[] list) { for(int i:list) { System.out.println(i);

    if (i==10) break;

    }

  4. public static void foo(int[] list) { while(list.length gt; 0) { System.out.println(i);

    if (i==10) break;

    }

  5. public static void foo(int[] list) { for(int i=0; i lt; list.length; i ) { System.out.println(i);

    if (i==10) break;

    }

    Answer: C

    Question No: 142 – (Topic 2)

    Given:

    1. public enum Color { RED, YELLOW, GREEN }

    2. enum Fruit {

    3. Banana(Color.RED),

    4. Apple(Color.YELLOW),

    5. Kiwi(Color.GREEN);

    6. private Color color;

    7. Fruit(Color color) {

    8. this.color = color; 9. }

10. }

  1. class Test {

  2. public void method() {

  3. // insert code here

14. }

15. }

Which two, inserted independently at line 13, allow the code to compile? (Choose two.)

  1. Color red = Color.values[0];

  2. Fruit f = Banana;

  3. Fruit[] fruits = Fruit.values();

  4. Fruit f = new Fruit(Color.RED);

  5. Fruit f = Fruit.Banana; switch (f) { }

Answer: C,E

Question No: 143 – (Topic 2)

Which two are characteristics of an RDBMS? (Choose two.)

  1. Business-tier applications use session beans to represent rows in an RDBMS.

  2. Java technologies provide capabilities for connecting a legacy RDBMS to a web application.

  3. An RDBMS represents data using two-dimensional tables.

  4. J2EE provides a cross-platform RDBMS.

  5. An RDBMS represents data using three-dimensional tables.

Answer: B,C

Question No: 144 – (Topic 2)

Which statement about java.util is incorrect?

  1. It contains the collections framework.

  2. It contains classes necessary to implement networking applications.

  3. It contains HashSet and Vector.

  4. It contains classes used to manipulate dates.

    Answer: B

    Question No: 145 – (Topic 2)

    Given:

    1. class Exam {

    2. private int num = 0;

    3. public int getNum() {

    4. return num; 5. }

6. }

  1. public class Sample {

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

  3. Exam e = new Exam(); 10. e.num = 100;

  1. int num = e.getNum();

  2. System.out.println(quot;The number is: quot; num);

13. }

14. }

What is the result?

  1. The number is: 100

  2. Compilation fails.

  3. The number is: 0

  4. An exception is thrown at runtime.

Answer: B

Question No: 146 – (Topic 2)

Which two are benefits of JSP technology? (Choose two.)

  1. separation of servlet developer and JSP author roles

  2. separation of dynamic and static content

  3. simplified Swing GUI development

  4. portability to any HTTP server

Answer: A,B

Question No: 147 – (Topic 2)

Which two are true about HTML? (Choose two.)

  1. HTML documents CANNOT be browsed by a text editor.

  2. HTML uses tags to structure text into headings, paragraphs, and lists.

  3. HTML can set up hypertext links between documents.

  4. HTML is an object-oriented programming language.

Answer: B,C

Question No: 148 – (Topic 2)

Which is an advantage of applets over HTML/JavaScript clients?

  1. In their default state, applets have access to the client#39;s computer.

  2. Applets can use a wider variety of UI components.

  3. Applets are downloaded more quickly to the client.

  4. Applets are more widely supported by browsers.

Answer: B

Question No: 149 – (Topic 2)

Given:

  1. class Test {

  2. public static void main(String args[]) { 4. for (int i = 1; i lt; 5; i ) {

5. if (i == 2) {

6. continue; 7. }

8. System.out.print(quot; i = quot; i); 9. }

10. }

11. }

What is the result?

A. i = 1 i = 3 i = 4 i = 5

B. i = 1

C. i = 1 i = 3 i = 4

D. The code runs with no output.

E. i = 1 i = 2 i = 4

F. i = 1 i = 2 i = 4 i = 5

G. Compilation fails.

Answer: C

Question No: 150 – (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?

  1. Declare a local variable invokeCount inside the go() method, and increment the variable within the go() method.

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

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

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

Answer: B

100% Ensurepass Free Download!
Download Free Demo:1z0-850 Demo PDF
100% Ensurepass Free Guaranteed!
1z0-850 Dumps

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.