New Year Sale - Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70dumps

1z0-808 Questions and Answers

Question # 6

Given:

And given the code fragment:

What is the result?

A.

300:300200:300

B.

300:100200:300

C.

300:00:300

D.

100:300300:200

Full Access
Question # 7

Given:

What is the result?

A.

An exception is thrown at runtime.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails.

Full Access
Question # 8

Given:

What is the result?

A.

C B A

B.

C

C.

A B C

D.

Compilation fails at line n1 and line n2

Full Access
Question # 9

Given the code fragment:

What is the result?

A.

Element 0Element 1

B.

Null element 0Null element 1

C.

NullNull

D.

A NullPointerException is thrown at runtime.

Full Access
Question # 10

Given the code fragment:

Test.java:

Which is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 11

Given:

What is the result?

A.

BaseDerivedA

B.

BaseDerivedB

C.

DerivedBDerivedB

D.

DerivedBDerivedA

E.

A ClassCastException is thrown at runtime.

Full Access
Question # 12

Given the code fragment:

What is the result?

A.

1 2 3 4followed by an ArrayIndexOutOfBoundsException

B.

1 2 3

C.

1 2 3 4

D.

Compilation fails.

Full Access
Question # 13

Given:

And given the code fragment:

What is the result?

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

Full Access
Question # 14

Given the code fragment:

What is the result?

A.

[Robb, Rick, Bran]

B.

[Robb, Rick]

C.

[Robb, Bran, Rick, Bran]

D.

An exception is thrown at runtime.

Full Access
Question # 15

Given the code fragment:

What is the result?

A.

May 04, 2014T00:00:00.000

B.

2014-05-04T00:00: 00.000

C.

5/4/14T00:00:00.000

D.

An exception is thrown at runtime.

Full Access
Question # 16

Which three statements describe the object-oriented features of the Java language? (Choose three.)

A.

Objects cannot be reused.

B.

A subclass must override the methods from a superclass.

C.

Objects can share behaviors with other objects.

D.

A package must contain a main class.

E.

Object is the root class of all other objects.

F.

A main method must be declared in every class.

Full Access
Question # 17

Which statement best describes encapsulation?

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.

Full Access
Question # 18

Given:

And given the commands:

What is the result?

A.

1 null

B.

true false

C.

false false

D.

true true

E.

A ClassCastException is thrown at runtime.

Full Access
Question # 19

Given the code fragment:

Which three code fragments can be independently inserted at line n1 to enable the code to print One? (Choose three.)

A.

byte x = 1;

B.

short x = 1;

C.

String x = "1";

D.

long x = 1;

E.

double x = 1;

F.

Integer x = new Integer("1");

Full Access
Question # 20

Given the code fragment:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 21

Given the code fragment:

Which two modifications, when made independently, enable the code to print Joe:true: 100.0? (Choose two.)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 22

Given:

And the code fragment:

Which code fragment, when inserted at line 14, enables the code to print Mike Found?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 23

Given the code fragment:

What is the result?

A.

[JavaForum, ExpertForum]

B.

[JavaGroup, ExpertGroup]

C.

[JavaForumGroup, ExpertForumGroup]

D.

[JavaGroup, TechGroup ExpertGroup]

Full Access
Question # 24

Given the code fragment:

What is the result?

A.

A B C Work done

B.

A B C D Work done

C.

A Work done

D.

Compilation fails

Full Access
Question # 25

Given:

What is the result?

A.

Compilation fails.

B.

false true

C.

true false

D.

true true

E.

false false

Full Access
Question # 26

Which three statements are true about the structure of a Java class? (Choose three.)

A.

A public class must have a main method.

B.

A class can have only one private constructors.

C.

A method can have the same name as a field.

D.

A class can have overloaded static methods.

E.

The methods are mandatory components of a class.

F.

The fields need not be initialized before use.

Full Access
Question # 27

Which two class definitions fail to compile? (Choose two.)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 28

Given:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 29

Given the code fragment:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 30

Given:

What is the result?

A.

100 200 : 0 0 :

B.

100 200 : 100 0 :

C.

100 200 : 100 200 :

D.

0 0 : 100 0 :

Full Access
Question # 31

Given:

What is the result?

A.

3 4 5 6

B.

3 4 3 6

C.

5 4 5 6

D.

3 6 5 6

Full Access
Question # 32

Given:

Which code fragment should you use at line n1 to instantiate the dvd object successfully?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 33

Given the code fragment:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 34

Given the code fragment:

What is the result?

A.

A B C

B.

A B C D E

C.

A B D E

D.

Compilation fails.

Full Access
Question # 35

Which statement is true about the switch statement?

A.

It must contain the default section.

B.

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

C.

Its case label literals can be changed at runtime.

D.

Its expression must evaluate to a collection of values.

Full Access
Question # 36

Given these classes:

And given this main method:

Which two options compile when placed at line n1 of the main method? (Choose two.)

A.

director.stockOptions = 1_000;

B.

employee.salary = 50_000;

C.

manager.budget = 1_000_000;

D.

manager.stockOption = 500;

E.

employee.budget = 200_000;

F.

director.salary = 80_000;

Full Access
Question # 37

Which two statements are true? (Choose two.)

A.

Error class is unextendable.

B.

Error class is extendable.

C.

Error is a RuntimeException.

D.

Error is an Exception.

E.

Error is a Throwable.

Full Access
Question # 38

Given the code fragment:

What is the result?

A.

3

B.

4

C.

-1

D.

Compilation fails.

Full Access
Question # 39

Given the following main method:

What is the result?

A.

5 4 3 2 1 0

B.

5 4 3 2 1

C.

4 2 1

D.

5

E.

Nothing is printed

Full Access
Question # 40

Given:

What is the result?

A.

Compilation fails at line n1.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails at line n2.

Full Access
Question # 41

Given:

And given the code fragment:

Book book1 = new EBook();

book1.readBook();

Which option enables the code to compile?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 42

Given the code fragment:

And given the requirements:

1. Process all the elements of the array in the order of entry.

2. Process all the elements of the array in the reverse order of entry.

3. Process alternating elements of the array in the order of entry.

Which two statements are true? (Choose two.)

A.

Requirements 1, 2, and 3 can be implemented by using the enhanced for loop.

B.

Requirements 1, 2, and 3 can be implemented by using the standard for loop.

C.

Requirements 2 and 3 CANNOT be implemented by using the standard for loop.

D.

Requirement 1 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.

Full Access
Question # 43

Given the code fragment:

What is the result?

A.

Compilation fails at both line n1 and line n2.

B.

Compilation fails only at line n2.

C.

Compilation fails only at line n1.

D.

Jesse 25Walter 52

Full Access
Question # 44

Given:

What is the result?

A.

An exception is thrown at runtime.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails.

Full Access
Question # 45

Given:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 46

Given the code fragment:

Which three lines fail to compile? (Choose three.)

A.

Line 7

B.

Line 8

C.

Line 9

D.

Line 10

E.

Line 11

F.

Line 12

Full Access
Question # 47

Given:

What is the result?

A.

10:20

B.

0:20

C.

Compilation fails at line n1

D.

Compilation fails at line n2

Full Access
Question # 48

You are asked to develop a program for a shopping application, and you are given this information:

  • The application must contain the classes Toy, EduToy, and ConsToy. The Toy class is the superclass of the other two classes.
  • The int calculatePrice (Toy t) method calculates the price of a toy.
  • The void printToy (Toy t) method prints the details of a toy.

Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 49

Given:

What is the result?

A.

BaseDerivedA

B.

BaseDerivedB

C.

DerivedBDerivedB

D.

DerivedBDerivedA

E.

A ClassCastException is thrown at runtime.

Full Access
Question # 50

Given the code fragments:

And:

Which statement is true?

A.

After line 11, three objects are eligible for garbage collection.

B.

After line 11, two objects are eligible for garbage collection.

C.

After line 11, one object is eligible for garbage collection.

D.

After line 11, none of the objects are eligible for garbage collection.

Full Access
Question # 51

Given the code fragment:

What is the result?

A.

Sum is 600

B.

Compilation fails at line n1.

C.

Compilation fails at line n2.

D.

A ClassCastException is thrown at line n1.

E.

A ClassCastException is thrown at line n2.

Full Access
Question # 52

Given:

What is the result?

A.

Vehicle Bus

B.

Bus

Vehicle

C.

Bus

D.

The program doesn’t print anything

Full Access
Question # 53

Given the code fragment:

What is the result?

A.

A B C

B.

A B C D E

C.

A B D E

D.

Compilation fails.

Full Access
Question # 54

Given the code fragment:

What is the result?

A.

S 6

B.

S 5

C.

s-1

D.

w 7

Full Access
Question # 55

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?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 56

Given the code fragment:

What is the result?

A.

true true

B.

true false

C.

false false

D.

false true

Full Access
Question # 57

Given the code fragment:

What is the result?

A.

A NullPointerException is thrown at runtime.

B.

[1, 2, 4]

C.

[1, 2, 4, null]

D.

[1, 3, 4, null]

E.

[1, 3, 4]

F.

Compilation fails.

Full Access
Question # 58

Given the code fragments:

What is the result?

A.

Compilation fails only at line n2.

B.

RTool::exportTool::export

C.

Tool::exportTool:export

D.

Compilation fails only at line n1.

E.

Compilation fails at both line n1 and line n2.

Full Access
Question # 59

Given the code fragment:

What is the result?

A.

1:2:3:4:5:

B.

1:2:3:

C.

Compilation fails.

D.

An ArrayOutOfBoundsException is thrown at runtime.

Full Access
Question # 60

Given:

Which statement is true?

A.

The program executes and prints:

500.0

B.

Commenting line 16 enables the program to print:

Thank You! 500.0

C.

Commenting line 13 enables the program to print:

Thank You! 500.0

D.

The program executes and prints:

Thank You! 500.0

Full Access
Question # 61

Given:

Acc.java:

Which statement is true?

A.

Both p and s are accessible via obj.

B.

Only s is accessible via obj.

C.

Both r and s are accessible via obj.

D.

p, r, and s are accessible via obj.

Full Access
Question # 62

Given the code fragment:

What is the result?

A.

[Robb, Rick, Bran]

B.

[Robb, Rick]

C.

[Robb, Bran, Rick, Bran]

D.

An exception is thrown at runtime.

Full Access
Question # 63

Given:

What is the result?

A.

10:20

B.

0:20

C.

Compilation fails at line n1

D.

Compilation fails at line n2

Full Access
Question # 64

Given the code fragment:

What is the result?

A.

2012-02-10

B.

2012-01-30

C.

2012-02-10 00:00

D.

A DateTimeException is thrown at runtime.

Full Access
Question # 65

Given the code fragment:

Assume that the system date is June 20, 2014. What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 66

Given the code fragment:

Which code fragment, when inserted at line 3, enables the code to print 10:20?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 67

Given the following code:

What is the output?

A.

44

B.

35

C.

47

D.

54

E.

45

F.

421

Full Access