Oracle certification · Exam 1z0-808

1z0-808 Mock Exam

Java SE 8 Programmer I

Find out if you're ready for 1z0-808. Take the free timed mock exam and get your score in minutes, or study the free 1z0-808 questions below with answers and explanations.

20 questions · 33 minutes · free, no sign-up

Free 1z0-808 questions

1–10 of 70 free
Question 1 Choose 2

Which two are Java Exception classes?

Show answerHide answer

Correct answer: A, C

SercurityException

IllegalArgumentException

Question 2 Choose 1

Given the code fragment

Which code fragments, inserted independently, enable the code compile?

Show answerHide answer

Correct answer: B

cvar = 400;

Question 3 Choose 1

Given the code fragment:
public class Test {
public static void main(String[] args) {
boolean isChecked = false;
int arry[] = {1,3,5,7,8,9};
int index = arry.length;
while ( <code1> ) {
if (arry[index-1] % 2 ==0) {
isChecked = true;
}
<code2>
}
System.out.print(arry(index]+", "+isChecked));
}
}
Which set of changes enable the code to print 1, true?

Show answerHide answer

Correct answer: A

Replacing <code1> with index > 0 and replacing <code2> with index--;

Explanation

Note: Code in B (code2 is -index;). also works fine.

Question 4 Choose 1



What is the result?

Show answerHide answer

Correct answer: C

String main 1

Question 5 Choose 1

Which of the following exception will be thrown due to the statement given here?
int array[] = new int[-2];

Show answerHide answer

Correct answer: B

NegativeArraySizeException

Explanation

In given statement we can see that, we have passed negative value for creating int array,
which results a NegativeArraySize Except ion. Hence option B is correct.
Option A is incorrect as it is thrown when an application attempts to use null in a case
where an object is required.
Option D is incorrect as IndexOutOfBoundsException thrown to indicate that an index of
some sort (such as to an array, to a string, or to a vector) is out of range.
REFERENCE
rhttpy/docs.oracle.com/iavase/S/docs/api/java/lang/NegativeArraySizeException.html

Question 6 Choose 2

Which two statements are true for a two-dimensional array of primitive data type?

Show answerHide answer

Correct answer: C, D

At the declaration time, the number of elements of the array in each dimension must be
specified.

All methods of the class object may be invoked on the two-dimensional array.

Explanation

http://stackoverflow.com/questions/12806739/is-an-array-a-primitive-type-oran-
object-or-something-else-entirely

Question 7 Choose 2

Given the code fragment:


Which two modifications should you make so that the code compiles successfully?


Show answerHide answer

Correct answer: A, C

Option A

Option C

Explanation

Add throws clause in both printFileContent and main

Question 8 Choose 2

Show answerHide answer

Correct answer: A, C

Option A

Option C

Question 9 Choose 1

Given:
public class MainMethod {
void main() {
System.out.println("one");
}
static void main(String args) {
System.out.println("two");
}
public static void main(String[] args) {
System.out.println("three");
}
void mina(Object[] args) {
System.out.println("four");
}
}
What is printed out when the program is excuted?

Show answerHide answer

Correct answer: C

three

Question 10 Choose 1

Show answerHide answer

Correct answer: C

Option C

Full mock exam

Sit the 1z0-808 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real 1z0-808 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full 1z0-808 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 236questions in the bank
  • Newmock on every attempt