1Z0-851 Exam Details

  • Exam Code
    :1Z0-851
  • Exam Name
    :Oracle Solaris 11 System Administration
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :290 Q&As
  • Last Updated
    :Dec 10, 2021

Oracle 1Z0-851 Online Questions & Answers

  • Question 151:

    Given:

    11.

    String test = "Test A. Test B. Test C.";

    12.

    // insert code here

    13.

    String[] result = test.split(regex);

    Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?

    A. String regex = "";
    B. String regex = " ";
    C. String regex = ".*";
    D. String regex = "\\s";
    E. String regex = "\\.\\s*";
    F. String regex = "\\w[ \.] +";

  • Question 152:

    A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.)

    A. The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.
    B. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..
    C. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.
    D. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.
    E. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac 璫p /foo/myLib.jar/Paper Book.java.
    F. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac
    G. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac 璫lasspath /foo/myLib.jar Book.java

  • Question 153:

    Given:

    11.

    public void go(int x) {

    12.

    assert (x > 0);

    13.

    switch(x) {

    14.

    case 2: ;

    15.

    default: assert false;

    16.

    }

    17.

    }

    18.

    private void go2(int x) { assert (x < 0); }

    Which statement is true?

    A. All of the assert statements are used appropriately.
    B. Only the assert statement on line 12 is used appropriately.
    C. Only the assert statement on line 15 is used appropriately.
    D. Only the assert statement on line 18 is used appropriately.
    E. Only the assert statements on lines 12 and 15 are used appropriately.
    F. Only the assert statements on lines 12 and 18 are used appropriately.
    G. Only the assert statements on lines 15 and 18 are used appropriately.

  • Question 154:

    Given:

    5 import java.util.*;

    6 public class SortOf {

    7 public static void main(String[] args) {

    8 ArrayList a = new ArrayList(); 9 a.add(1); a.add(5); a.add(3);

    11 Collections.sort(a);

    12 a.add(2);

    13 Collections.reverse(a);

    14 System.out.println(a);

    15 }

    16 }

    What is the result?

    A. [1, 2, 3, 5]
    B. [2, 1, 3, 5]
    C. [2, 5, 3, 1]
    D. [5, 3, 2, 1]
    E. [1, 3, 5, 2]
    F. Compilation fails.
    G. An exception is thrown at runtime.

  • Question 155:

    Given a pre-generics implementation of a method:

    11.

    public static int sum(List list) {

    12.

    int sum = 0;

    13.

    for ( Iterator iter = list.iterator(); iter.hasNext(); ) {

    14.

    int i = ((Integer)iter.next()).intValue();

    15.

    sum += i;

    16.

    }

    17.

    return sum;

    18.

    }

    What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.)

    A. Remove line 14.
    B. Replace line 14 with "int i = iter.next();".
    C. Replace line 13 with "for (int i : intList) {".
    D. Replace line 13 with "for (Iterator iter : intList) {".
    E. Replace the method declaration with "sum(List intList)".
    F. Replace the method declaration with "sum(List intList)".

  • Question 156:

    Given:

    10.

    interface Data { public void load(); }

    11.

    abstract class Info { public abstract void load(); }

    Which class correctly uses the Data interface and Info class?

    A. public class Employee extends Info implements Data { public void load() { /*do something*/ } }
    B. public class Employee implements Info extends Data { public void load() { /*do something*/ } }
    C. public class Employee extends Info implements Data { public void load(){ /*do something*/ } public void Info.load(){ /*do something*/ } }
    D. public class Employee implements Info extends Data { public void Data.load(){ /*do something*/ } public void load(){ /*do something*/ } }
    E. public class Employee implements Info extends Data { public void load(){ /*do something*/ } public void Info.load(){ /*do something*/ } }
    F. public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }

  • Question 157:

    Given:

    31.

    class Foo {

    32.

    public int a = 3;

    33.

    public void addFive() { a += 5; System.out.print("f "); }

    34.

    }

    35.

    class Bar extends Foo {

    36.

    public int a = 8;

    37.

    public void addFive() { this.a += 5; System.out.print("b " ); }

    38.

    } Invoked with: Foo f = new Bar(); f.addFive(); System.out.println(f.a);

    What is the result?

    A. b 3
    B. b 8
    C. b 13
    D. f 3
    E. f 8
    F. f 13
    G. Compilation fails.
    H. An exception is thrown at runtime.

  • Question 158:

    Given:

    11.

    public interface A { public void m1(); }

    12.

    13.

    class B implements A { }

    14.

    class C implements A { public void m1() { } }

    15.

    class D implements A { public void m1(int x) { } }

    16.

    abstract class E implements A { }

    17.

    abstract class F implements A { public void m1() { } }

    18.

    abstract class G implements A { public void m1(int x) { } }

    What is the result?

    A. Compilation succeeds.
    B. Exactly one class does NOT compile.
    C. Exactly two classes do NOT compile.
    D. Exactly four classes do NOT compile.
    E. Exactly three classes do NOT compile.

  • Question 159:

    Given that the elements of a PriorityQueue are ordered according to natural ordering, and:

    2.

    import java.util.*;

    3.

    public class GetInLine {

    4.

    public static void main(String[] args) {

    5.

    PriorityQueue pq = new PriorityQueue();

    6.

    pq.add("banana");

    7.

    pq.add("pear");

    8.

    pq.add("apple");

    9.

    System.out.println(pq.poll() + " " + pq.peek());

    10.

    }

    11.

    }

    What is the result?

    A. apple pear
    B. banana pear
    C. apple apple
    D. apple banana
    E. banana banana

  • Question 160:

    Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?

    A. Compilation will succeed for all classes and interfaces.
    B. Compilation of class C will fail because of an error in line 2.
    C. Compilation of class C will fail because of an error in line 6.
    D. Compilation of class AImpl will fail because of an error in line 2.

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-851 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.