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

    Given:

    11.

    class Alpha {

    12.

    public void foo() { System.out.print("Afoo "); }

    13.

    }

    14.

    public class Beta extends Alpha {

    15.

    public void foo() { System.out.print("Bfoo "); }

    16.

    public static void main(String[] args) {

    17.

    Alpha a = new Beta();

    18.

    Beta b = (Beta)a;

    19.

    a.foo();

    20.

    b.foo();

    21.

    }

    22.

    }

    What is the result?

    A. Afoo Afoo
    B. Afoo Bfoo
    C. Bfoo Afoo
    D. Bfoo Bfoo
    E. Compilation fails.
    F. An exception is thrown at runtime.

  • Question 42:

    Given:

    1.

    public class Breaker2 {

    2.

    static String o = "";

    3.

    public static void main(String[] args) {

    4.

    z:

    5.

    for(int x = 2; x < 7; x++) {

    6.

    if(x==3) continue;

    7.

    if(x==5) break z;

    8.

    o = o + x;

    9.

    }

    10.

    System.out.println(o);

    11.

    }

    12.

    }

    What is the result?

    A. 2
    B. 24
    C. 234
    D. 246
    E. 2346
    F. Compilation fails.

  • Question 43:

    Given:

    11.

    public interface A111 {

    12.

    String s = "yo";

    13.

    public void method1();

    14.

    }

    17. interface B { }

    20.

    interface C extends A111, B {

    21.

    public void method1();

    22.

    public void method1(int x);

    23.

    }

    What is the result?

    A. Compilation succeeds.
    B. Compilation fails due to multiple errors.
    C. Compilation fails due to an error only on line 20.
    D. Compilation fails due to an error only on line 21.
    E. Compilation fails due to an error only on line 22.
    F. Compilation fails due to an error only on line 12.

  • Question 44:

    Given that t1 is a reference to a live thread, which is true?

    A. The Thread.sleep() method can take t1 as an argument.
    B. The Object.notify() method can take t1 as an argument.
    C. The Thread.yield() method can take t1 as an argument.
    D. The Thread.setPriority() method can take t1 as an argument.
    E. The Object.notify() method arbitrarily chooses which thread to notify.

  • Question 45:

    Given:

    10.

    interface Foo {}

    11.

    class Alpha implements Foo {}

    12.

    class Beta extends Alpha {}

    13.

    class Delta extends Beta {

    14.

    public static void main( String[] args ) {

    15.

    Beta x = new Beta();

    16.

    // insert code here

    17.

    }

    18.

    }

    Which code, inserted at line 16, will cause a java.lang.ClassCastException?

    A. Alpha a = x;
    B. Foo f = (Delta)x;
    C. Foo f = (Alpha)x;
    D. Beta b = (Beta)(Alpha)x;

  • Question 46:

    Given:

    1.

    public class Donkey {

    2.

    public static void main(String[] args) {

    3.

    boolean assertsOn = false;

    4.

    assert (assertsOn) : assertsOn = true;

    5.

    if(assertsOn) {

    6.

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

    7.

    }

    8.

    }

    9.

    }

    If class Donkey is invoked twice, the first time without assertions enabled, and the second time with assertions enabled, what are the results?

    A. no output
    B. no output assert is on
    C. assert is on
    D. no output An AssertionError is thrown.
    E. assert is on An AssertionError is thrown.

  • Question 47:

    Given:

    3.

    class Employee {

    4.

    String name; double baseSalary;

    5.

    Employee(String name, double baseSalary) {

    6.

    this.name = name;

    7.

    this.baseSalary = baseSalary;

    8.

    }

    9.

    }

    10.

    public class SalesPerson extends Employee {

    11.

    double commission;

    12.

    public SalesPerson(String name, double baseSalary, double commission) {

    13.

    // insert code here

    14.

    }

    15.

    }

    Which two code fragments, inserted independently at line 13, will compile? (Choose two.)

    A. super(name, baseSalary);
    B. this.commission = commission;
    C. super(); this.commission = commission;
    D. this.commission = commission; super();
    E. super(name, baseSalary); this.commission = commission;
    F. this.commission = commission; super(name, baseSalary);
    G. super(name, baseSalary, commission);

  • Question 48:

    Given a correctly compiled class whose source code is:

    1. package com.sun.sjcp;

    2. public class Commander {

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

    4. // more code here

    5. }

    6. }

    Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the classpath contains "." (current directory).

    Which command line correctly runs Commander?

    A. java Commander
    B. java com.sun.sjcp.Commander
    C. java com/sun/sjcp/Commander
    D. java -cp com.sun.sjcp Commander
    E. java -cp com/sun/sjcp Commander

  • Question 49:

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

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

    1.

    import java.io.*;

    2.

    public class Maker {

    3.

    public static void main(String[] args) {

    4.

    File dir = new File("dir");

    5.

    File f = new File(dir, "f");

    6.

    }

    7.

    }

    Which statement is true?

    A. Compilation fails.
    B. Nothing is added to the file system.
    C. Only a new file is created on the file system.
    D. Only a new directory is created on the file system.
    E. Both a new file and a new directory are created on the file system.

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.