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

    Given:

    1.

    public class Base {

    2.

    public static final String FOO = "foo";

    3.

    public static void main(String[] args) {

    4.

    Base b = new Base();

    5.

    Sub s = new Sub();

    6.

    System.out.print(Base.FOO);

    7.

    System.out.print(Sub.FOO);

    8.

    System.out.print(b.FOO);

    9.

    System.out.print(s.FOO);

    10.

    System.out.print(((Base)s).FOO);

    11.

    } }

    12.

    class Sub extends Base {public static final String FOO="bar";}

    What is the result?

    A. foofoofoofoofoo
    B. foobarfoobarbar
    C. foobarfoofoofoo
    D. foobarfoobarfoo
    E. barbarbarbarbar
    F. foofoofoobarbar
    G. foofoofoobarfoo

  • Question 192:

    Given:

    1.

    class ClassA {

    2.

    public int numberOfInstances;

    3.

    protected ClassA(int numberOfInstances) {

    4.

    this.numberOfInstances = numberOfInstances;

    5.

    }

    6.

    }

    7.

    public class ExtendedA extends ClassA {

    8.

    private ExtendedA(int numberOfInstances) {

    9.

    super(numberOfInstances);

    10.

    }

    11.

    public static void main(String[] args) {

    12.

    ExtendedA ext = new ExtendedA(420);

    13.

    System.out.print(ext.numberOfInstances);

    14.

    }

    15.

    }

    Which statement is true?

    A. 420 is the output.
    B. An exception is thrown at runtime.
    C. All constructors must be declared public.
    D. Constructors CANNOT use the private modifier.
    E. Constructors CANNOT use the protected modifier.

  • Question 193:

    Given:

    11.

    public class PingPong implements Runnable {

    12.

    synchronized void hit(long n) {

    13.

    for(int i = 1; i < 3; i++)

    14.

    System.out.print(n + "-" + i + " ");

    15.

    }

    16.

    public static void main(String[] args) {

    17.

    new Thread(new PingPong()).start();

    18.

    new Thread(new PingPong()).start();

    19.

    }

    20.

    public void run() {

    21.

    hit(Thread.currentThread().getId());

    22.

    }

    23.

    }

    Which two statements are true? (Choose two.)

    A. The output could be 8-1 7-2 8-2 7-1
    B. The output could be 7-1 7-2 8-1 6-1
    C. The output could be 8-1 7-1 7-2 8-2
    D. The output could be 8-1 8-2 7-1 7-2

  • Question 194:

    Given:

    11.

    public class Person {

    12.

    private String name, comment;

    13.

    private int age;

    14.

    public Person(String n, int a, String c) {

    15.

    name = n; age = a; comment = c;

    16.

    }

    17.

    public boolean equals(Object o) {

    18.

    if (! (o instanceof Person)) return false; 19, Person p = (Person)o;

    20.

    return age == p.age andand name.equals(p.name);

    21.

    }

    22.

    }

    What is the appropriate definition of the hashCode method in class Person?

    A. return super.hashCode();
    B. return name.hashCode() + age * 7;
    C. return name.hashCode() + comment.hashCode() / 2;
    D. return name.hashCode() + comment.hashCode() / 2 - age * 3;

  • Question 195:

    Which Man class properly represents the relationship "Man has a best friend who is a Dog"?

    A. class Man extends Dog { }
    B. class Man implements Dog { }
    C. class Man { private BestFriend dog; }
    D. class Man { private Dog bestFriend; }
    E. class Man { private Dog; }
    F. class Man { private BestFriend; }

  • Question 196:

    Given:

    12.

    Date date = new Date();

    13.

    df.setLocale(Locale.ITALY);

    14.

    String s = df.format(date);

    The variable df is an object of type DateFormat that has been initialized in line 11.

    What is the result if this code is run on December 14, 2000?

    A. The value of s is 14-dic-2000.
    B. The value of s is Dec 14, 2000.
    C. An exception is thrown at runtime.
    D. Compilation fails because of an error in line 13.

  • Question 197:

    Click the Exhibit button. What is the result?

    A. go in Goban go in Sente
    B. go in Sente go in Goban
    C. go in Sente go in Goban
    D. go in Goban go in Sente
    E. Compilation fails because of an error in line 17.

  • Question 198:

    Given:

    11.

    public class ItemTest {

    12.

    private final int id;

    13.

    public ItemTest(int id) { this.id = id; }

    14.

    public void updateId(int newId) { id = newId; } 15.

    16.

    public static void main(String[] args) {

    17.

    ItemTest fa = new ItemTest(42);

    18.

    fa.updateId(69);

    19.

    System.out.println(fa.id);

    20.

    }

    21.

    }

    What is the result?

    A. Compilation fails.
    B. An exception is thrown at runtime.
    C. The attribute id in the ItemTest object remains unchanged.
    D. The attribute id in the ItemTest object is modified to the new value.
    E. A new ItemTest object is created with the preferred value in the id attribute.

  • Question 199:

    Which two code fragments correctly create and initialize a static array of int elements? (Choose two.)

    A. static final int[] a = { 100,200 };
    B. static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
    C. static final int[] a = new int[2]{ 100,200 };
    D. static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }

  • Question 200:

    Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true? (Choose two.)

    A. The class implements java.lang.Comparable.
    B. The class implements java.util.Comparator.
    C. The interface used to implement sorting allows this class to define only one sort sequence.
    D. The interface used to implement sorting allows this class to define many different sort sequences.

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.