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

    Given:

    1.

    public class Plant {

    2.

    private String name;

    3.

    public Plant(String name) { this.name = name; }

    4.

    public String getName() { return name; }

    5.

    }

    1.

    public class Tree extends Plant {

    2.

    public void growFruit() { }

    3.

    public void dropLeaves() { }

    4.

    }

    Which statement is true?

    A. The code will compile without changes.
    B. The code will compile if public Tree() { Plant(); } is added to the Tree class.
    C. The code will compile if public Plant() { Tree(); } is added to the Plant class.
    D. The code will compile if public Plant() { this("fern"); } is added to the Plant class.
    E. The code will compile if public Plant() { Plant("fern"); } is added to the Plant class.

  • Question 82:

    Given the following directory structure:

    bigProject |--source | |--Utils.java | |--classes |-- And the following command line invocation: javac -d classes source/Utils.java

    Assume the current directory is bigProject, what is the result?

    A. If the compile is successful, Utils.class is added to the source directory.
    B. The compiler returns an invalid flag error.
    C. If the compile is successful, Utils.class is added to the classes directory.
    D. If the compile is successful, Utils.class is added to the bigProject directory.

  • Question 83:

    Given:

    11.

    public static void main(String[] args) {

    12.

    Integer i = new Integer(1) + new Integer(2);

    13.

    switch(i) {

    14.

    case 3: System.out.println("three"); break;

    15.

    default: System.out.println("other"); break;

    16.

    }

    17.

    }

    What is the result?

    A. three
    B. other
    C. An exception is thrown at runtime.
    D. Compilation fails because of an error on line 12.
    E. Compilation fails because of an error on line 13.
    F. Compilation fails because of an error on line 15.

  • Question 84:

    Given:

    3.

    interface Animal { void makeNoise(); }

    4.

    class Horse implements Animal {

    5.

    Long weight = 1200L;

    6.

    public void makeNoise() { System.out.println("whinny"); }

    7.

    }

    8.

    public class Icelandic extends Horse {

    9.

    public void makeNoise() { System.out.println("vinny"); }

    10.

    public static void main(String[] args) {

    11.

    Icelandic i1 = new Icelandic();

    12.

    Icelandic i2 = new Icelandic();

    13.

    Icelandic i3 = new Icelandic();

    14.

    i3 = i1; i1 = i2; i2 = null; i3 = i1;

    15.

    }

    16.

    }

    When line 15 is reached, how many objects are eligible for the garbage collector?

    B. 1
    C. 2
    D. 3
    E. 4
    F. 6

  • Question 85:

    Given:

    11.

    interface DeclareStuff {

    12.

    public static final int EASY = 3;

    13.

    void doStuff(int t); }

    14.

    public class TestDeclare implements DeclareStuff {

    15.

    public static void main(String [] args) {

    16.

    int x = 5;

    17.

    new TestDeclare().doStuff(++x);

    18.

    }

    19.

    void doStuff(int s) {

    20.

    s += EASY + ++s;

    21.

    System.out.println("s " + s);

    22.

    }

    23.

    }

    What is the result?

    A. s 14
    B. s 16
    C. s 10
    D. Compilation fails.
    E. An exception is thrown at runtime.

  • Question 86:

    Given:

    11.

    static void test() throws Error {

    12.

    if (true) throw new AssertionError();

    13.

    System.out.print("test ");

    14.

    }

    15.

    public static void main(String[] args) {

    16.

    try { test(); }

    17.

    catch (Exception ex) { System.out.print("exception "); }

    18.

    System.out.print("end ");

    19.

    }

    What is the result?

    A. end
    B. Compilation fails.
    C. exception end
    D. exception test end
    E. A Throwable is thrown by main.
    F. An Exception is thrown by main.

  • Question 87:

    Given:

    5.

    class Building { }

    6.

    public class Barn extends Building {

    7.

    public static void main(String[] args) {

    8.

    Building build1 = new Building();

    9.

    Barn barn1 = new Barn();

    10.

    Barn barn2 = (Barn) build1;

    11.

    Object obj1 = (Object) build1;

    12.

    String str1 = (String) build1;

    13.

    Building build2 = (Building) barn1;

    14.

    }

    15.

    }

    Which is true?

    A. If line 10 is removed, the compilation succeeds.
    B. If line 11 is removed, the compilation succeeds.
    C. If line 12 is removed, the compilation succeeds.
    D. If line 13 is removed, the compilation succeeds.
    E. More than one line must be removed for compilation to succeed.

  • Question 88:

    Given:

    1.

    public class Score implements Comparable {

    2.

    private int wins, losses;

    3.

    public Score(int w, int l) { wins = w; losses = l; }

    4.

    public int getWins() { return wins; }

    5.

    public int getLosses() { return losses; }

    6.

    public String toString() {

    7.

    return "<" + wins + "," + losses + ">";

    8.

    }

    9.

    // insert code here

    10.

    }

    Which method will complete this class?

    A. public int compareTo(Object o){/*more code here*/}
    B. public int compareTo(Score other){/*more code here*/}
    C. public int compare(Score s1,Score s2){/*more code here*/}
    D. public int compare(Object o1,Object o2){/*more code here*/}

  • Question 89:

    Given:

    5 class Atom {

    6 Atom() { System.out.print("atom "); }

    7 }

    8 class Rock extends Atom {

    9 Rock(String type) { System.out.print(type); } 10 }

    11 public class Mountain extends Rock {

    12 Mountain() {

    13. super("granite ");

    14 new Rock("granite ");

    15 }

    16 public static void main(String[] a) { new Mountain(); } 17 }

    What is the result?

    A. Compilation fails.
    B. atom granite
    C. granite granite
    D. atom granite granite
    E. An exception is thrown at runtime.
    F. atom granite atom granite

  • Question 90:

    Given:

    11. interface DeclareStuff {

    12. public static final int EASY = 3;

    13. void doStuff(int t); }

    14. public class TestDeclare implements DeclareStuff {

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

    16. int x = 5;

    17. new TestDeclare().doStuff(++x);

    18. }

    19. void doStuff(int s) {

    20. s += EASY + ++s;

    21. System.out.println("s " + s);

    22. }

    23.

    }

    What is the result?

    A. s 14
    B. s 16
    C. s 10
    D. Compilation fails.
    E. 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.