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

    Given:

    5.

    class A {

    6.

    void foo() throws Exception { throw new Exception(); }

    7.

    }

    8.

    class SubB2 extends A {

    9.

    void foo() { System.out.println("B "); }

    10.

    }

    11.

    class Tester {

    12.

    public static void main(String[] args) {

    13.

    A a = new SubB2();

    14.

    a.foo();

    15.

    }

    16.

    }

    What is the result?

    A. B
    B. B, followed by an Exception.
    C. Compilation fails due to an error on line 9.
    D. Compilation fails due to an error on line 14.
    E. An Exception is thrown with no other output.

  • Question 2:

    Given:

    34.

    HashMap props = new HashMap();

    35.

    props.put("key45", "some value");

    36.

    props.put("key12", "some other value");

    37.

    props.put("key39", "yet another value");

    38.

    Set s = props.keySet();

    39.

    // insert code here

    What, inserted at line 39, will sort the keys in the props HashMap?

    A. Arrays.sort(s);
    B. s = new TreeSet(s);
    C. Collections.sort(s);
    D. s = new SortedSet(s);

  • Question 3:

    Given:

    1.

    package geometry;

    2.

    public class Hypotenuse {

    3.

    public InnerTriangle it = new InnerTriangle();

    4.

    class InnerTriangle {

    5.

    public int base;

    6.

    public int height;

    7.

    }

    8.

    }

    Which statement is true about the class of an object that can reference the variable base?

    A. It can be any class.
    B. No class has access to base.
    C. The class must belong to the geometry package.
    D. The class must be a subclass of the class Hypotenuse.

  • Question 4:

    Given:

    1.

    interface DoStuff2 {

    2.

    float getRange(int low, int high); }

    3.

    4.

    interface DoMore {

    5.

    float getAvg(int a, int b, int c); }

    6.

    7.

    abstract class DoAbstract implements DoStuff2, DoMore { } 8.

    9.

    class DoStuff implements DoStuff2 {

    10.

    public float getRange(int x, int y) { return 3.14f; } } 11.

    12.

    interface DoAll extends DoMore {

    13.

    float getAvg(int a, int b, int c, int d); }

    What is the result?

    A. The file will compile without error.
    B. Compilation fails. Only line 7 contains an error.
    C. Compilation fails. Only line 12 contains an error.
    D. Compilation fails. Only line 13 contains an error.
    E. Compilation fails. Only lines 7 and 12 contain errors.
    F. Compilation fails. Only lines 7 and 13 contain errors.
    G. Compilation fails. Lines 7, 12, and 13 contain errors.

  • Question 5:

    Given a pre-generics implementation of a method:

    11 public static int sum(List list) {

    12 int sum = 0;

    13 for ( Iterator iter = list.iterator(); iter.hasNext(); ) { 14 int i = ((Integer)iter.next()).intValue(); 15 sum += i;

    16 }

    17 return sum;

    18 }

    What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.)

    A. Remove line 14.
    B. Replace line 14 with "int i = iter.next();".
    C. Replace line 13 with "for (int i : intList) {".
    D. Replace line 13 with "for (Iterator iter : intList) {".
    E. Replace the method declaration with "sum(List intList)".
    F. Replace the method declaration with "sum(List intList)".

  • Question 6:

    Given:

    11.

    Float pi = new Float(3.14f);

    12.

    if (pi > 3) {

    13.

    System.out.print("pi is bigger than 3. ");

    14.

    }

    15.

    else {

    16.

    System.out.print("pi is not bigger than 3. ");

    17.

    }

    18.

    finally {

    19.

    System.out.println("Have a nice day.");

    20.

    }

    What is the result?

    A. Compilation fails.
    B. pi is bigger than 3.
    C. An exception occurs at runtime.
    D. pi is bigger than 3. Have a nice day.
    E. pi is not bigger than 3. Have a nice day.

  • Question 7:

    Given:

    11.

    public static void main(String[] args) {

    12.

    String str = "null";

    13.

    if (str == null) {

    14.

    System.out.println("null");

    15.

    } else (str.length() == 0) {

    16.

    System.out.println("zero");

    17.

    } else {

    18.

    System.out.println("some");

    19.

    }

    20.

    }

    What is the result?

    A. null
    B. zero
    C. some
    D. Compilation fails.
    E. An exception is thrown at runtime.

  • Question 8:

    Given:

    10. interface Jumper { public void jump(); } ...

    20. class Animal {} ...

    30.

    class Dog extends Animal {

    31.

    Tail tail; 32. } ...

    40.

    class Beagle extends Dog implements Jumper{

    41.

    public void jump() {}

    42.

    } ...

    50.

    class Cat implements Jumper{

    51.

    public void jump() {}

    52.

    }

    Which three are true? (Choose three.)

    A. Cat is-a Animal
    B. Cat is-a Jumper
    C. Dog is-a Animal
    D. Dog is-a Jumper
    E. Cat has-a Animal
    F. Beagle has-a Tail
    G. Beagle has-a Jumper

  • Question 9:

    Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object? (Choose two.)

    A. When using versions of Java technology earlier than 5.0.
    B. When sharing a StringBuffer among multiple threads.
    C. When using the java.io class StringBufferInputStream.
    D. When you plan to reuse the StringBuffer to build more than one string.

  • Question 10:

    Given:

    11.

    class ClassA {}

    12.

    class ClassB extends ClassA {}

    13.

    class ClassC extends ClassA {} and:

    21.

    ClassA p0 = new ClassA();

    22.

    ClassB p1 = new ClassB();

    23.

    ClassC p2 = new ClassC();

    24.

    ClassA p3 = new ClassB();

    25.

    ClassA p4 = new ClassC();

    Which three are valid? (Choose three.)

    A. p0 = p1;
    B. p1 = p2;
    C. p2 = p4;
    D. p2 = (ClassC)p1;
    E. p1 = (ClassB)p3;
    F. p2 = (ClassC)p4;

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.