Oracle certification · Exam 1z0-808

1z0-808 Mock Exam Page 5

Java SE 8 Programmer I

Free 1z0-808 mock exam questions 41–50, each with the answer and an explanation.

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

Free 1z0-808 questions

41–50 of 70 free
Question 41 Choose 1


Which statement is true?

Show answerHide answer

Correct answer: B

Only s is accessible by obj.

Question 42 Choose 1

Given the code fragment:  
What is the result?

Show answerHide answer

Correct answer: B

Found Teal

Question 43 Choose 1

Which statement is/are true?
I. Default constructor only contains "super();" call.
II. We can't use any access modifier with a constructor.
III. A constructor should not have a return type.

Show answerHide answer

Correct answer: D

Only I and III.

Explanation

Statement I is correct as the default constructor only contains super0 call
Statement II is incorrect as we can use any access modifier with a constructor.
Statement III is correct as constructor can't have return type, even void.
So option D is correct.
httpsy/docs.oracle.com/javase/tutorial/iava/javaOO/construaors.html

Question 44 Choose 1

Given:
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass(); SampleClass sc = new
SampleClass();
sc = asc;
System.out.println("sc: " + sc.getClass());
System.out.println("asc: " + asc.getClass());
}}
class AnotherSampleClass extends SampleClass {
}
What is the result?

Show answerHide answer

Correct answer: D

sc: class AnotherSampleClass
asc: class AnotherSampleClass

Question 45 Choose 2

Given:


Show answerHide answer

Correct answer: B, C

Option B

Option C

Explanation

When an abstract class is subclassed, the subclass usually provides
implementations for all of the abstract methods in its parent class (C). However, if it does
not, then the subclass must also be declared abstract (B).
Note: An abstract class is a class that is declared abstract—it may or may not include
abstract methods. Abstract classes cannot be instantiated, but they can be subclassed

Question 46 Choose 1

Given the code fragment

Which option represents the state of the num array after successful completion of the outer
loop?


Show answerHide answer

Correct answer: A

Option A

Question 47 Choose 1

Given:

What is the result?

Show answerHide answer

Correct answer: E

Compilation fails

Question 48 Choose 1

View the exhibit.

Which change enables the code to print the following?
James age: 20
Williams age: 32

Show answerHide answer

Correct answer: C

Enclosing line 6 and line 7 within a try block and adding:
catch(Exception e1) { //code goes here}
catch (missingInfoException e2) { //code goes here}
catch (AgeOutofRangeException e3) {//code goes here}

Question 49 Choose 1

Given the code fragment:

What is the result?

Show answerHide answer

Correct answer: A

10 : 10

Question 50 Choose 1

Given the code fragment:

Which modification enables the code to print 54321?

Show answerHide answer

Correct answer: B

At line 7, insert x --;

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