Latest Oracle 1z0-808 Exam questions and answers [Q61-Q84]

Share

Latest Oracle 1z0-808 Exam questions and answers

PrepAwayExam 1z0-808 Exam Practice Test Questions (Updated 225 Questions)


Oracle 1z0-808 Exam Syllabus Topics:

TopicDetails
Topic 1
  • Import Other Java Packages To Make Them Accessible In Your Code
Topic 2
  • Compare And Contrast The Features And Components Of Java Such As: Platform Independence, Object Orientation, Encapsulation
Topic 3
  • Use Super And This To Access Objects And Constructors
  • Working With Selected Classes From The Java API
Topic 4
  • Describe Inheritance And Its Benefits
  • Determine When Casting Is Necessary
  • Use Abstract Classes And Interfaces
Topic 5
  • Determine The Effect Upon Object References And Primitive Values When They Are Passed Into Methods That Change The Values
Topic 6
  • Develop Code That Makes Use Of Polymorphism; Develop Code That Overrides Methods
  • Differentiate Between The Type Of A Reference And The Type Of An Object
Topic 7
  • Apply The Static Keyword To Methods And Fields
  • Apply Encapsulation Principles To A Class
Topic 8
  • Use Java Operators; Use Parentheses To Override Operator Precedence
Topic 9
  • Define The Scope Of Variables
  • Define The Structure Of A Java Class
Topic 10
  • Create And Use While Loops, Create And Use Do
  • While Loops, Compare Loop Constructs, Use Break And Continue
Topic 11
  • Develop Code That Uses Wrapper Classes Such As Boolean, Double, And Integer
  • Create Methods With Arguments And Return Values; Including Overloaded Methods
Topic 12
  • Know How To Read Or Write To Object Fields
  • Explain An Object's Lifecycle (Creation, "Dereference By Reassignment" And Garbage Collection)

 

NEW QUESTION 61
Given: What is result?

  • A. Compilation fails
  • B. An exception is thrown at runtime
  • C. Unsuccessful
  • D. Successful

Answer: A

 

NEW QUESTION 62
Given:

What is the result?
A:

B:

C:

D:

  • A. Option A
  • B. Option D
  • C. Option C
  • D. Option B

Answer: B

 

NEW QUESTION 63
Given:

What is the result?

  • A. 100 200 : 100 200 :
  • B. 100 0 : 100 200:
  • C. 100 0 : 100 0 :
  • D. 100 200 : 100 0 :

Answer: D

 

NEW QUESTION 64
Given:

Which constructor initializes the variable x3?

  • A. Only the default constructor of object class
  • B. Only the no-argument constructor of class Y
  • C. Only the default constructor of class X
  • D. Only the no-argument constructor of class Z

Answer: D

 

NEW QUESTION 65
Given:

And given the commands:

What is the result?
TRUE null

  • A. false false
  • B. true false
  • C. true true
  • D.
  • E. A ClassCastExceptionis thrown at runtime.

Answer: D

 

NEW QUESTION 66
Which statement is true about Java byte code?

  • A. It can run on any platform.
  • B. It can run on any platform only if that platform has both the Java Runtime Environment and a Java compiler.
  • C. It can run on any platform that has a Java compiler.
  • D. It can run on any platform only if it was compiled for that platform.
  • E. It can run on any platform that has the Java Runtime Environment.

Answer: C

Explanation:
Reference: http://www.math.uni-hamburg.de/doc/java/tutorial/getStarted/intro/definition.html
Explanation:
Java bytecodes help make "write once, run anywhere" possible. You can compile your program into bytecodes on any platform that has a Java compiler. The bytecodes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

 

NEW QUESTION 67
You are developing a banking module. You have developed a class named ccMask that has a maskcc method.
Given the code fragment:

You must ensure that the maskcc method returns a string that hides all digits of the credit card number except the four last digits (and the hyphens that separate each group of four digits).
Which two code fragments should you use at line n1, independently, to achieve this requirement?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D

Answer: B,C

 

NEW QUESTION 68
Given the code fragment:
int[] array = {I, 2, 3, 4, 5};
And given the requirements:
-Process all the elements of the array in the order of entry. -Process all the elements of the array in the reverse order of entry. -Process alternating elements of the array in the order of entry.
Which two statements are true?

  • A. Requirements 1, 2, and 3 can be implemented by using the standard for loop.
  • B. Requirement 1 can be implemented by using the enhanced for loop.
  • C. Requirements 2 and 3 CANNOT be implemented by using the standard for loop.
  • D. Requirements 1, 2, and 3 can be implemented by using the enhanced for loop.
  • E. Requirement 3 CANNOT be implemented by using either the enhanced for loop or the standard for loop.

Answer: A

 

NEW QUESTION 69
Given the code from the Greeting.Java file:

Which set of commands prints Hello Duke in the console?

  • A. Option A
  • B. Option C
  • C. Option D
  • D. Option B

Answer: B

 

NEW QUESTION 70
Given:

What is the result?

  • A. Compilation fails at line n1
  • B. Area is 6.0
  • C. Area is 3.0
  • D. Compilation fails at line n2.

Answer: B

 

NEW QUESTION 71
Given:

This class is poorly encapsulated. You need to change the circle class to compute and return the area instead.
What three modifications are necessary to ensure that the class is being properly encapsulated?

  • A. When the radius is set in the Circle constructor and the setRadius () method, recomputed the area and store it into the area field
  • B. Change the getArea () method public double getArea () { return area; }
  • C. Change the getRadius () method:
    public double getRadius () {
    area = Math.PI * radius * radius;
    return radius;
    }
  • D. Change the access modifier of the setradius () method to private

Answer: A,B,C

 

NEW QUESTION 72
Which statement initializes a stringBuilder to a capacity of 128?

  • A. StringBuilder sb = new String ("128");
  • B. StringBuilder sb = StringBuilder.getInstance (128);
  • C. StringBuilder sb = StringBuilder.setCapacity (128);
  • D. StringBuilder sb = new StringBuilder (128);

Answer: D

Explanation:
StringBuilder(int capacity) Constructs a string builder with no characters in it and an initial capacity specified by the capacity argument. Note: An instance of a StringBuilder is a mutable sequence of characters. The principal operations on a StringBuilder are the append and insert methods, which are overloaded so as to accept data of any type. Each effectively converts a given datum to a string and then appends or inserts the characters of that string to the string builder. The append method always adds these characters at the end of the builder; the insert method adds the characters at a specified point.

 

NEW QUESTION 73
Given the code snippet from a compiled Java source file:

Which command-line arguments should you pass to the program to obtain the following output?
Arg is 2

  • A. java MyFile 1 2 2 3 4
  • B. java MyFile 2 2 2
  • C. java MyFile 1 3 2 2
  • D. java MyFile 0 1 2 3

Answer: C

 

NEW QUESTION 74
Given the code fragment:
What is the result?
A:

B:

C:

D:

E:

  • A. Option E
  • B. Option A
  • C. Option D
  • D. Option C
  • E. Option B

Answer: A

Explanation:
Explanation/Reference:
Explanation:

 

NEW QUESTION 75
Given the following code:

What are the values of each element in intArr after this code has executed?

  • A. 15, 4, 45, 60, 90
  • B. 15, 30, 90, 60, 90
  • C. 15, 90, 45, 90, 75
  • D. 15, 30, 75, 60, 90
  • E. 15, 60, 45, 90, 75

Answer: D

 

NEW QUESTION 76
Given:

What is the result?

  • A. Option A
  • B. Option B
  • C. Option D
  • D. Option C

Answer: B

 

NEW QUESTION 77
Given the code fragment:

What is the result?

  • A.
  • B.
  • C.
  • D.
    Invalid Name

Answer: C

Explanation:

 

NEW QUESTION 78
Given the code fragment:

What is the result?

  • A. Compilation fails.
  • B. 1 2 3
  • C. 1 2 3 4
  • D. 1 2 3 4followed by an ArrayIndexOutOfBoundsException

Answer: B

 

NEW QUESTION 79
Given the code fragment:

What is the result?

  • A. Compilation fails
  • B. 0 2 4
  • C. 0 2 4 6
  • D. 2 4

Answer: B

 

NEW QUESTION 80
Given the code fragment:

Which three code fragments can be independently inserted at line n1 to enable the code to print one?

  • A. Long x = 1;
  • B. Integer x = new Integer ("1");
  • C. String x = "1";
  • D. Double x = 1;
  • E. Byte x = 1;
  • F. short x = 1;

Answer: B,E,F

 

NEW QUESTION 81
Given:

What is the result?
Compilation fails at line n3 and line n4.

  • A. Welcome Visit Count: 2
  • B. Compilation fails at line n1 and line n2.
  • C. Welcome Visit Count:1
  • D. Welcome Visit Count: 1
    Welcome Visit Count:1

Answer: C

 

NEW QUESTION 82
Given the code fragment:

What is the result?

  • A. 2014-07-31
  • B. 2014-09-30
  • C. An exception is thrown at runtime.
  • D. 07-31-2014

Answer: A

 

NEW QUESTION 83
Given the code snippet from a compiled Java source file:

and this output:

Which command should you run to obtain this output?

  • A. java MyFile 1 2 2
  • B. java MyFile 2
  • C. java MyFile 1 2 3 4
  • D. java MyFile 2 2

Answer: A

 

NEW QUESTION 84
......

Pass Your Oracle Exam with 1z0-808 Exam Dumps: https://www.prepawayexam.com/Oracle/braindumps.1z0-808.ete.file.html

Pass 1z0-808 Exam Info and Free Practice Test: https://drive.google.com/open?id=1nAWfbgJAK_8UQkcwUagnS5L0TK5XkCar