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 261:

    Given:

    11.

    public static void test(String str) {

    12.

    int check = 4;

    13.

    if (check = str.length()) {

    14.

    System.out.print(str.charAt(check -= 1) +", ");

    15.

    } else {

    16.

    System.out.print(str.charAt(0) + ", ");

    17.

    }

    18.

    } and the invocation:

    21.

    test("four");

    22.

    test("tee");

    23.

    test("to");

    What is the result?

    A. r, t, t,
    B. r, e, o,
    C. Compilation fails.
    D. An exception is thrown at runtime.

  • Question 262:

    A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly. What design flaw is most likely the cause of these new bugs?

    A. Inheritance
    B. Tight coupling
    C. Low cohesion
    D. High cohesion
    E. Loose coupling
    F. Object immutability

  • Question 263:

    Given:

    11.

    class A {

    12.

    public void process() { System.out.print("A,"); }

    13.

    class B extends A {

    14.

    public void process() throws IOException {

    15.

    super.process();

    16.

    System.out.print("B,");

    17.

    throw new IOException();

    18.

    }

    19.

    public static void main(String[] args) {

    20.

    try { new B().process(); }

    21.

    catch (IOException e) { System.out.println("Exception"); }

    22.

    }

    What is the result?

    A. Exception
    B. A,B,Exception
    C. Compilation fails because of an error in line 20.
    D. Compilation fails because of an error in line 14.
    E. A NullPointerException is thrown at runtime.

  • Question 264:

    Given:

    1.

    public class TestSeven extends Thread {

    2.

    private static int x;

    3.

    public synchronized void doThings() {

    4.

    int current = x;

    5.

    current++;

    6.

    x = current;

    7.

    }

    8.

    public void run() {

    9.

    doThings();

    10.

    } 11.}

    Which statement is true?

    A. Compilation fails.
    B. An exception is thrown at runtime.
    C. Synchronizing the run() method would make the class thread-safe.
    D. The data in variable "x" are protected from concurrent access problems.
    E. Declaring the doThings() method as static would make the class thread-safe.
    F. Wrapping the statements within doThings() in a synchronized(new Object()) { } block would make the class thread-safe.

  • Question 265:

    Given:

    21.

    abstract class C1 {

    22.

    public C1() { System.out.print(1); }

    23.

    }

    24.

    class C2 extends C1 {

    25.

    public C2() { System.out.print(2); }

    26.

    }

    27.

    class C3 extends C2 {

    28.

    public C3() { System.out.println(3); }

    29.

    }

    30.

    public class Ctest {

    31.

    public static void main(String[] a) { new C3(); }

    32.

    }

    What is the result?

    A. 3
    B. 23
    C. 32
    D. 123
    E. 321
    F. Compilation fails.
    G. An exception is thrown at runtime.

  • Question 266:

    Which two code fragments will execute the method doStuff() in a separate thread? (Choose two.)

    A. new Thread() { public void run() { doStuff(); } };
    B. new Thread() { public void start() { doStuff(); } };
    C. new Thread() { public void start() { doStuff(); } }.run();
    D. new Thread() { public void run() { doStuff(); } }.start();
    E. new Thread(new Runnable() { public void run() { doStuff(); } }).run();
    F. new Thread(new Runnable() { public void run() { doStuff(); } }).start();

  • Question 267:

    Given:

    12.

    public class Test {

    13.

    public enum Dogs {collie, harrier};

    14.

    public static void main(String [] args) {

    15.

    Dogs myDog = Dogs.collie;

    16.

    switch (myDog) {

    17.

    case collie:

    18.

    System.out.print("collie ");

    19.

    case harrier:

    20.

    System.out.print("harrier ");

    21.

    }

    22.

    }

    23.

    }

    What is the result?

    A. collie
    B. harrier
    C. Compilation fails.
    D. collie harrier
    E. An exception is thrown at runtime.

  • Question 268:

    Given:

    11. class X { public void foo() { System.out.print("X "); } } 12.

    13.

    public class SubB extends X {

    14.

    public void foo() throws RuntimeException {

    15.

    super.foo();

    16.

    if (true) throw new RuntimeException();

    17.

    System.out.print("B ");

    18.

    }

    19.

    public static void main(String[] args) {

    20.

    new SubB().foo();

    21.

    }

    22.

    }

    What is the result?

    A. X, followed by an Exception.
    B. No output, and an Exception is thrown.
    C. Compilation fails due to an error on line 14.
    D. Compilation fails due to an error on line 16.
    E. Compilation fails due to an error on line 17.
    F. X, followed by an Exception, followed by B.

  • Question 269:

    Given:

    1.

    public class BuildStuff {

    2.

    public static void main(String[] args) {

    3.

    Boolean test = new Boolean(true);

    4.

    Integer x = 343;

    5.

    Integer y = new BuildStuff().go(test, x);

    6.

    System.out.println(y);

    7.

    }

    8.

    int go(Boolean b, int i) {

    9.

    if(b) return (i/7);

    10.

    return (i/49);

    11.

    }

    12.

    }

    What is the result?

    A. 7
    B. 49
    C. 343
    D. Compilation fails.
    E. An exception is thrown at runtime.

  • Question 270:

    Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100? (Choose three.)

    A. n = 100;
    B. i.setX( 100 );
    C. o.getY().setX( 100 );
    D. i = new Inner(); i.setX( 100 );
    E. o.setY( i ); i = new Inner(); i.setX( 100 );
    F. i = new Inner(); i.setX( 100 ); o.setY( i );

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.