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

    Given:

    1.

    public class Threads4 {

    2.

    public static void main (String[] args) {

    3.

    new Threads4().go();

    4.

    }

    5.

    public void go() {

    6.

    Runnable r = new Runnable() {

    7.

    public void run() {

    8.

    System.out.print("foo");

    9.

    }

    10.

    };

    11.

    Thread t = new Thread(r);

    12.

    t.start();

    13.

    t.start();

    14.

    }

    15.

    }

    What is the result?

    A. Compilation fails.
    B. An exception is thrown at runtime.
    C. The code executes normally and prints "foo".
    D. The code executes normally, but nothing is printed.

  • Question 12:

    DRAG DROP

    Select and Place:

  • Question 13:

    Given a class Repetition:

    1.

    package utils;

    2.

    3.

    public class Repetition {

    4.

    public static String twice(String s) { return s + s; }

    5.

    } and given another class Demo:

    1.

    // insert code here

    2.

    3.

    public class Demo {

    4.

    public static void main(String[] args) {

    5.

    System.out.println(twice("pizza"));

    6.

    }

    7.

    }

    Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?

    A. import utils.*;
    B. static import utils.*;
    C. import utils.Repetition.*;
    D. static import utils.Repetition.*;
    E. import utils.Repetition.twice();
    F. import static utils.Repetition.twice;
    G. static import utils.Repetition.twice;

  • Question 14:

    DRAG DROP

    Select and Place:

  • Question 15:

    Given that the current directory is empty, and that the user has read and write permissions, and the following:

    11.

    import java.io.*;

    12.

    public class DOS {

    13.

    public static void main(String[] args) {

    14.

    File dir = new File("dir");

    15.

    dir.mkdir();

    16.

    File f1 = new File(dir, "f1.txt");

    17.

    try {

    18.

    f1.createNewFile();

    19.

    } catch (IOException e) { ; }

    20.

    File newDir = new File("newDir");

    21.

    dir.renameTo(newDir);

    22.

    }

    23.

    }

    Which statement is true?

    A. Compilation fails.
    B. The file system has a new empty directory named dir.
    C. The file system has a new empty directory named newDir.
    D. The file system has a directory named dir, containing a file f1.txt.
    E. The file system has a directory named newDir, containing a file f1.txt.

  • Question 16:

    Given:

    10.

    class Nav{

    11.

    public enum Direction { NORTH, SOUTH, EAST, WEST }

    12.

    }

    13.

    public class Sprite{

    14.

    // insert code here

    15.

    }

    Which code, inserted at line 14, allows the Sprite class to compile?

    A. Direction d = NORTH;
    B. Nav.Direction d = NORTH;
    C. Direction d = Direction.NORTH;
    D. Nav.Direction d = Nav.Direction.NORTH;

  • Question 17:

    Given:

    3. public class Batman {

    4. int squares = 81;

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

    6.

    new Batman().go();

    7.

    }

    8.

    void go() {

    9.

    incr(++squares);

    10.

    System.out.println(squares);

    11.

    }

    12.

    void incr(int squares) { squares += 10; }

    13.

    }

    What is the result?

    A. 81
    B. 82
    C. 91
    D. 92
    E. Compilation fails.
    F. An exception is thrown at runtime.

  • Question 18:

    DRAG DROP

    Select and Place:

  • Question 19:

    Given:

    1.

    interface A { public void aMethod(); }

    2.

    interface B { public void bMethod(); }

    3.

    interface C extends A,B { public void cMethod(); }

    4.

    class D implements B {

    5.

    public void bMethod(){}

    6.

    }

    7.

    class E extends D implements C {

    8.

    public void aMethod(){}

    9.

    public void bMethod(){}

    10.

    public void cMethod(){}

    11.

    }

    What is the result?

    A. Compilation fails because of an error in line 3.
    B. Compilation fails because of an error in line 7.
    C. Compilation fails because of an error in line 9.
    D. If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.
    E. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.
    F. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.

  • Question 20:

    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.

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.