Winter Sale - Limited Time 55% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 5763r953

Welcome To DumpsPedia

1z0-808 Sample Questions Answers

Questions 4

Given:

What is the result?

Options:

A.

null:null:0.0

B.

null:null

C.

<>:0.0

D.

null:0.0

Buy Now
Questions 5

Given the code fragment:

What is the result?

Options:

A.

5 : 5

B.

10 : 10

C.

5 : 10

D.

Compilation fails.

Buy Now
Questions 6

Given:

What is the result?

Options:

A.

C B A

B.

C

C.

A B C

D.

Compilation fails at line n1 and line n2

Buy Now
Questions 7

Given the following class declarations:

  • public abstract class Animal
  • public interface Hunter
  • public class Cat extends Animal implements Hunter
  • public class Tiger extends Cat

Which answer fails to compile?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 8

Given the code fragment:

What is the result?

Options:

A.

1 2 3 0 01 2 3 0 0

B.

An Exception is thrown at run time.

C.

1 2 3 0 01 2 3

D.

1 2 31 2 3

Buy Now
Questions 9

Given the following code:

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

Options:

A.

15, 60, 45, 90, 75

B.

15, 90, 45, 90, 75

C.

15, 30, 75, 60, 90

D.

15, 30, 90, 60, 90

E.

15, 4, 45, 60, 90

Buy Now
Questions 10

Given the code fragment:

Test.java:

Which is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 11

Given the code fragment:

What is the result?

Options:

A.

2012-02-10

B.

2012-02-11

C.

Compilation fails

D.

A DateTimeException is thrown at runtime.

Buy Now
Questions 12

Given the code fragment:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 13

Given:

What is the result?

Options:

A.

nullRichardDonald

B.

RichardDonald

C.

Compilation fails.

D.

An ArrayIndexOutOfBoundsException is thrown at runtime.

E.

A NullPointerException is thrown at runtime.

Buy Now
Questions 14

Given:

Given the code fragment:

Which two sets of actions, independently, enable the code fragment to print Fit?

Options:

A.

At line n1 insert: import clothing.Shirt;At line n2 insert: String color = Shirt.getColor();

B.

At line n1 insert: import clothing;At line n2 insert: String color = Shirt.getColor();

C.

At line n1 insert: import static clothing.Shirt.getColor;At line n2 insert: String color = getColor();

D.

At line n1 no changes required.At line n2 insert: String color = Shirt.getColor();

E.

At line n1 insert: import Shirt;At line n2 insert: String color = Shirt.getColor();

Buy Now
Questions 15

Given the code fragment:

What is the result?

Options:

A.

Compilation fails.

B.

The program compiles, but it prints nothing.

C.

HiHowAreYou removed

D.

An UnsupportedOperationException is thrown at runtime.

Buy Now
Questions 16

Given the code fragment:

What is the result?

Options:

A.

2012-02-10

B.

2012-01-30

C.

2012-02-10 00:00

D.

A DateTimeException is thrown at runtime.

Buy Now
Questions 17

Given:

And given the code fragment:

What is the result?

Options:

A.

4W 100 Auto4W 150 Manual

B.

null 0 Auto4W 150 Manual

C.

Compilation fails only at line n1

D.

Compilation fails only at line n2

E.

Compilation fails at both line n1 and line n2

Buy Now
Questions 18

Given the code fragment:

Which code fragment, when inserted at line 9, enables the code to print true?

Options:

A.

String str2 = str1;

B.

String str2 = new String(str1);

C.

String str2 = sb1. toString();

D.

String str2 = "Duke";

Buy Now
Questions 19

Given:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 20

Given:

What is the result?

Options:

A.

10

20

B.

A compile time error occurs

C.

20

20

D.

10

10

Buy Now
Questions 21

Which statement best describes encapsulation?

Options:

A.

Encapsulation ensures that classes can be designed so that only certain fields and methods of an object are accessible from other objects.

B.

Encapsulation ensures that classes can be designed so that their methods are inheritable.

C.

Encapsulation ensures that classes can be designed with some fields and methods declared as abstract.

D.

Encapsulation ensures that classes can be designed so that if a method has an argument MyType x, any subclass of MyType can be passed to that method.

Buy Now
Questions 22

Given:

Which action fixes the compiler error?

Options:

A.

At line 17, add throws AccessViolationException

B.

At line 13, add throws LogFileException

C.

At line 2, replace throws LogFileException with throws AccessViolationException

D.

At line 7, insert throw new LogFileException ();

Buy Now
Questions 23

What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?

Options:

A.

Encapsulation

B.

Inheritance

C.

Abstraction

D.

Instantiation

E.

Polymorphism

Buy Now
Questions 24

Given the code fragment:

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

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 25

Given the code fragment:

What is the result?

Options:

A.

[Robb, Rick, Bran]

B.

[Robb, Rick]

C.

[Robb, Bran, Rick, Bran]

D.

An exception is thrown at runtime.

Buy Now
Questions 26

Given:

And given the code fragment:

Book book1 = new EBook();

book1.readBook();

Which option enables the code to compile?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 27

Given these two classes:

Any amount of electricity used by a customer (represented by an instance of the Customer class) must contribute to the customer's bill (represented by the member variable bill) through the useElectricity method.

An instance of the Customer class should never be able to tamper with or decrease the value of the member variable bill.

How should you write methods in the ElectricAccount class at line n1 so that the member variable bill is always equal to the value of the member variable kwh multiplied by the member variable rate?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 28

Given:

What is the result?

Options:

A.

double sum is 30.0 float sum is 30.0

B.

float sum is 30.0 double sum is 30.0

C.

Integer sum is 30 double sum is 30.0

D.

Integer sum is 30 float sum is 30.0

Buy Now
Questions 29

Which statement is true about Java byte code?

Options:

A.

It can run on any platform.

B.

It can run on any platform only if it was compiled for that platform.

C.

It can run on any platform that has the Java Runtime Environment.

D.

It can run on any platform that has a Java compiler.

E.

It can run on any platform only if that platform has both the Java Runtime Environment and a Java compiler.

Buy Now
Questions 30

Which statement is true about the switch statement?

Options:

A.

It must contain the default section.

B.

The break statement, at the end of each case block, is mandatory.

C.

Its case label literals can be changed at runtime.

D.

Its expression must evaluate to a single value.

Buy Now
Questions 31

Given:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 32

Given:

What is the result?

Options:

A.

3 4 5 6

B.

3 4 3 6

C.

5 4 5 6

D.

3 6 4 6

Buy Now
Questions 33

Which two statements are true about Java byte code? (Choose two.)

Options:

A.

It can be serialized across network.

B.

It can run on any platform that has a Java compiler.

C.

It can run on any platform.

D.

It has “.java” extension.

E.

It can run on any platform that has the Java Runtime Environment.

Buy Now
Exam Code: 1z0-808
Exam Name: Java SE 8 Programmer I
Last Update: Feb 1, 2023
Questions: 223
$72  $159.99
$54  $119.99
$45  $99.99
buy now 1z0-808