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

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

    Given:

    1.

    public class Target {

    2.

    private int i = 0;

    3.

    public int addOne(){

    4.

    return ++i;

    5.

    }

    6.

    } And:

    1.

    public class Client {

    2.

    public static void main(String[] args){

    3.

    System.out.println(new Target().addOne());

    4.

    }

    5.

    }

    Which change can you make to Target without affecting Client?

    A. Line 4 of class Target can be changed to return i++;
    B. Line 2 of class Target can be changed to private int i = 1;
    C. Line 3 of class Target can be changed to private int addOne(){
    D. Line 2 of class Target can be changed to private Integer i = 0;

  • Question 113:

    Which two code fragments are most likely to cause a StackOverflowError? (Choose two.)

    A. int []x = {1,2,3,4,5}; for(int y = 0; y < 6; y++) System.out.println(x[y]);
    B. static int[] x = {7,6,5,4}; static { x[1] = 8; x[4] = 3; }
    C. for(int y = 10; y < 10; y++) doStuff(y);
    D. void doOne(int x) { doTwo(x); } void doTwo(int y) { doThree(y); } void doThree(int z) { doTwo(z); } doStuff(x);
    E. for(int x = 0; x < 1000000000; x++)
    F. void counter(int i) { counter(++i); }

  • Question 114:

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

    Given:

    11 public class Person {

    12 private name;

    13 public Person(String name) {

    14 this.name = name;

    15 }

    16 public int hashCode() {

    17 return 420;

    18 }

    19 }

    Which statement is true?

    A. The time to find the value from HashMap with a Person key depends on the size of the map.
    B. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person.
    C. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a duplicate.
    D. The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map.

  • Question 116:

    Given:

    1.

    public class Mule {

    2.

    public static void main(String[] args) {

    3.

    boolean assert = true;

    4.

    if(assert) {

    5.

    System.out.println("assert is true");

    6.

    }

    7.

    }

    8.

    }

    Which command-line invocations will compile?

    A. javac Mule.java
    B. javac -source 1.3 Mule.java
    C. javac -source 1.4 Mule.java
    D. javac -source 1.5 Mule.java

  • Question 117:

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

    Click the Exhibit button. Which three statements are true? (Choose three.)

    A. Compilation fails.
    B. The code compiles and the output is 2.
    C. If lines 16, 17 and 18 were removed, compilation would fail.
    D. If lines 24, 25 and 26 were removed, compilation would fail.
    E. If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.
    F. If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.

  • Question 119:

    Given:

    5.

    class Thingy { Meter m = new Meter(); }

    6.

    class Component { void go() { System.out.print("c"); } }

    7.

    class Meter extends Component { void go() { System.out.print("m"); } } 8.

    9.

    class DeluxeThingy extends Thingy {

    10.

    public static void main(String[] args) {

    11.

    DeluxeThingy dt = new DeluxeThingy();

    12.

    dt.m.go();

    13.

    Thingy t = new DeluxeThingy();

    14.

    t.m.go();

    15.

    }

    16.

    }

    Which two are true? (Choose two.)

    A. The output is mm.
    B. The output is mc.
    C. Component is-a Meter.
    D. Component has-a Meter.
    E. DeluxeThingy is-a Component.
    F. DeluxeThingy has-a Component.

  • Question 120:

    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

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.