We provide real 1Z0-851 exam questions and answers braindumps in two formats. Download PDF & Practice Tests. Pass Oracle 1Z0-851 Exam quickly & easily. The 1Z0-851 PDF type is available for reading and printing. You can print more and practice many times. With the help of our Oracle 1Z0-851 dumps pdf and vce product and material, you can easily pass the 1Z0-851 exam.


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-851 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-851 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1Z0-851-exam-dumps.html

Q51. A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality. If they implement the new design, which two OO principles will they be promoting?

A. Looser coupling

B. Tighter coupling

C. Lower cohesion

D. Higher cohesion

E. Weaker encapsulation

F. Stronger encapsulation

Answer: A


Q52. 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<bestFriend>; }

F. class Man { private BestFriend<dog>; }

Answer: D


Q53. DRAG DROP

Click the Task button.

Answer:


Q54. Given:

11. class Mammal { }

12.

13. class Raccoon extends Mammal {

14. Mammal m = new Mammal();

15. }

16.

17. class BabyRaccoon extends Mammal { } Which four statements are true? (Choose four.)

A. Raccoon is-a Mammal.

B. Raccoon has-a Mammal.

C. BabyRaccoon is-a Mammal.

D. BabyRaccoon is-a Raccoon.

E. BabyRaccoon has-a Mammal.

F. BabyRaccoon is-a BabyRaccoon.

Answer: ABCF


Q55. Given:

1. import java.util.*;

2. public class Example {

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

4. // insert code here

5. set.add(new Integer(2));

6. set.add(new Integer(1));

7. System.out.println(set);

8. }

9. }

Which code, inserted at line 4, guarantees that this program will output [1, 2]?

A. Set set = new TreeSet();

B. Set set = new HashSet();

C. Set set = new SortedSet();

D. List set = new SortedList();

E. Set set = new LinkedHashSet();

Answer: A


Q56. 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; }

Answer: AB


Q57. 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);

Answer: B


Q58. Given that the current directory is empty, and that the user has read and write permissions, and the following:

11. import java.io.*;

12. public class DOS {

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

14. File dir = new File("dir");

15. dir.mkdir();

16. File f1 = new File(dir, "f1.txt");

17. try {

18. f1.createNewFile();

19. } catch (IOException e) { ; }

20. File newDir = new File("newDir");

21. dir.renameTo(newDir);

22. }

23. }

Which statement is true?

A. Compilation fails.

B. The file system has a new empty directory named dir.

C. The file system has a new empty directory named newDir.

D. The file system has a directory named dir, containing a file f1.txt.

E. The file system has a directory named newDir, containing a file f1.txt.

Answer: E


Q59. 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.

Answer: B


Q60. 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.

Answer: D