# Oracle (1Z0-808) Exam Questions And Answers page 4

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

A

C

C

C

C

C

A ClassCastException is thrown only at line n1.

A ClassCastException is thrown only at line n2.

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

Hello Log 1:0

Hello Log 2:1

Welcome Log 2:1

Welcome Log 1:0

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

Hello Log 2:2

Welcome Log 1:2

Welcome Log 2:1

Hello Log 1:2

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

null

Richard

Donald

Richard

Donald

Richard

Donald

Donald

Compilation fails.

An ArrayIndexOutOfBoundsException is thrown at runtime.

A NullPointerException is thrown at runtime.

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

An exception is thrown at runtime.

Initialized

Started

Initialized

Started

Initialized

Initialized

Started

Started

Compilation fails.

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

Compilation fails.

false true

true false

true true

false false

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the result of the given code fragment?

Single Choice

Given:

And given the code fragment:

What is the result?

And given the code fragment:

What is the result?

Compilation fails at line n2.

Read Book

Read E-Book

Compilation fails at line n1.

Compilation fails at line n3.

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

Using Operators and Decision Constructs
Working with Methods and Encapsulation

### What is the expected result of the given scenario?

Single Choice

Given:

What is the result?

What is the result?

97 98

99 100 null null null

99 100 null null null

97 98

99 100 101 102 103

99 100 101 102 103

Compilation fails.

A NullPointerException is thrown at runtime.

An ArraylndexOutOfBoundsException is thrown at runtime.

Using Operators and Decision Constructs
Working with Methods and Encapsulation

## Comments