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

    Given:

    1.

    d is a valid, non-null Date object

    2.

    df is a valid, non-null DateFormat object set to the current locale

    What outputs the current locale's country name and the appropriate version of d's date?

    A. Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry() + " " + df.format(d));
    B. Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry() + " " + df.format(d));
    C. Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry() + " " + df.setDateFormat(d));
    D. Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry() + " " + df.setDateFormat(d));

  • Question 142:

    Given:

    10.

    public class Foo {

    11.

    static int[] a;

    12.

    static { a[0]=2; }

    13.

    public static void main( String[] args ) {}

    14.

    }

    Which exception or error will be thrown when a programmer attempts to run this code?

    A. java.lang.StackOverflowError
    B. java.lang.IllegalStateException
    C. java.lang.ExceptionInInitializerError
    D. java.lang.ArrayIndexOutOfBoundsException

  • Question 143:

    Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?

    A. Compilation fails.
    B. ClassC is displayed.
    C. The code runs with no output.
    D. An exception is thrown at runtime.

  • Question 144:

    Given:

    1.

    public class Boxer1{

    2.

    Integer i;

    3.

    int x;

    4.

    public Boxer1(int y) {

    5.

    x = i+y;

    6.

    System.out.println(x);

    7.

    }

    8.

    public static void main(String[] args) {

    9.

    new Boxer1(new Integer(4));

    10.

    }

    11.

    }

    What is the result?

    A. The value "4" is printed at the command line.
    B. Compilation fails because of an error in line 5.
    C. Compilation fails because of an error in line 9.
    D. A NullPointerException occurs at runtime.
    E. A NumberFormatException occurs at runtime.
    F. An IllegalStateException occurs at runtime.

  • Question 145:

    Given:

    2.

    public class Hi {

    3.

    void m1() { }

    4.

    protected void() m2 { }

    5.

    }

    6.

    class Lois extends Hi {

    7.

    // insert code here

    8.

    }

    Which four code fragments, inserted independently at line 7, will compile? (Choose four.)

    A. public void m1() { }
    B. protected void m1() { }
    C. private void m1() { }
    D. void m2() { }
    E. public void m2() { }
    F. protected void m2() { }
    G. private void m2() { }

  • Question 146:

    Given:

    11.

    public class Person {

    12.

    private String name;

    13.

    public Person(String name) {

    14.

    this.name = name;

    15.

    }

    16.

    public boolean equals(Object o) {

    17.

    if ( ! ( o instanceof Person) ) return false;

    18.

    Person p = (Person) o;

    19.

    return p.name.equals(this.name);

    20.

    }

    21.

    }

    Which statement is true?

    A. Compilation fails because the hashCode method is not overridden.
    B. A HashSet could contain multiple Person objects with the same name.
    C. All Person objects will have the same hash code because the hashCode method is not overridden.
    D. If a HashSet contains more than one Person object with name="Fred", then removing another Person, also with name="Fred", will remove them all.

  • Question 147:

    Given:

    11.

    public class Test {

    12.

    public enum Dogs {collie, harrier, shepherd};

    13.

    public static void main(String [] args) {

    14.

    Dogs myDog = Dogs.shepherd;

    15.

    switch (myDog) {

    16.

    case collie:

    17.

    System.out.print("collie ");

    18.

    case default:

    19.

    System.out.print("retriever ");

    20.

    case harrier:

    21.

    System.out.print("harrier ");

    22.

    }

    23.

    }

    24.

    }

    What is the result?

    A. harrier
    B. shepherd
    C. retriever
    D. Compilation fails.
    E. retriever harrier
    F. An exception is thrown at runtime.

  • Question 148:

    Given:

    11.

    public static Iterator reverse(List list) {

    12.

    Collections.reverse(list);

    13.

    return list.iterator();

    14.

    }

    15.

    public static void main(String[] args) {

    16.

    List list = new ArrayList();

    17.

    list.add("1"); list.add("2"); list.add("3");

    18.

    for (Object obj: reverse(list))

    19.

    System.out.print(obj + ", ");

    20.

    }

    What is the result?

    A. 3, 2, 1,
    B. 1, 2, 3,
    C. Compilation fails.
    D. The code runs with no output.
    E. An exception is thrown at runtime.

  • Question 149:

    Given:

    11.

    static void test() throws RuntimeException {

    12.

    try {

    13.

    System.out.print("test ");

    14.

    throw new RuntimeException();

    15.

    }

    16.

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

    17.

    }

    18.

    public static void main(String[] args) {

    19.

    try { test(); }

    20.

    catch (RuntimeException ex) { System.out.print("runtime "); }

    21.

    System.out.print("end ");

    22.

    }

    What is the result?

    A. test end
    B. Compilation fails.
    C. test runtime end
    D. test exception end
    E. A Throwable is thrown by main at runtime.

  • Question 150:

    Given:

    12.

    NumberFormat nf = NumberFormat.getInstance();

    13.

    nf.setMaximumFractionDigits(4);

    14.

    nf.setMinimumFractionDigits(2);

    15.

    String a = nf.format(3.1415926);

    16.

    String b = nf.format(2);

    Which two statements are true about the result if the default locale is Locale.US? (Choose two.)

    A. The value of b is 2.
    B. The value of a is 3.14.
    C. The value of b is 2.00.
    D. The value of a is 3.141.
    E. The value of a is 3.1415.
    F. The value of a is 3.1416.
    G. The value of b is 2.0000.

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.