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

1z0-808 PDF

$33

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

1z0-808 PDF + Testing Engine

$52.8

$175.99

3 Months Free Update

  • Exam Name: Java SE 8 Programmer I
  • Last Update: Jan 13, 2025
  • Questions and Answers: 224
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

1z0-808 Engine

$39.6

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

1z0-808 Practice Exam Questions with Answers Java SE 8 Programmer I Certification

Question # 6

Given these requirements:

  • Bus and Boat are Vehicle type classes.
  • The start() and stop() methods perform common operations across the Vehicle class type.
  • The ride() method performs a unique operations for each type of Vehicle.

Which set of actions meets the requirements with optimized code?

A.

1. Create an abstract class Vehicle by defining start() and stop() methods, and declaring the ride()

abstract method.

2. Create Bus and Boat classes by inheriting the Vehicle class and overriding the ride() method.

B.

1. Create an interface Vehicle by defining start() and stop() methods, and declaring the ride()

abstract method.

2. Create Bus and Boat classes by implementing the Vehicle class.

C.

1. Create an abstract class Vehicle by declaring stop(), start(), and ride() abstract methods.

2. Create Bus and Boat classes by inheriting the Vehicle class and overriding all the methods.

D.

1. Create an interface Vehicle by defining default stop(), start(), and ride() methods.

2. Create Bus and Boat classes by implementing the Vehicle interface and overriding the ride()

method.

Full Access
Question # 7

Given the code fragment:

1z0-808 question answer

Which option can replace xxx to enable the code to print 135?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 8

Given:

1z0-808 question answer

What is the result? A. 0:0

100:0

B.null:0

100:0

C.0:0

100:200

D.null:null 100:null

Full Access
Question # 9

Given:

1z0-808 question answer

And:

1z0-808 question answer

What is the result?

A.

ns = 100 s =125

ns = 0 s = 125

ns = 125 s = 125

B.

ns = 50 s = 50

ns = 125 s = 125

ns = 0 s = 125

C.

ns = 50 s = 125 ns = 125 s = 125

ns = 0 s = 125

D.

ns = 50 s = 50 ns = 125 s =125

ns = 100 s =100

Full Access
Question # 10

You are developing a banking module. You have developed a class named ccMask that has a maskcc method.

Given the code fragment:

1z0-808 question answer

You must ensure that the maskcc method returns a string that hides all digits of the credit card number except the four last digits (and the hyphens that separate each group of four digits).

Which two code fragments should you use at line n1, independently, to achieve this requirement? (Choose two.)

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 11

Given the class definitions:

class C1 {}

class C2 extends C1 {}

class C3 extends C2 {}

and the code fragment:

16.C1 obj1 = (C1) new C2();

17.C2 obj2 = (C2) new C3();

18.C2 obj3 = (C2) new C1();

19.C3 obj4 = (C3) obj2;

Which line throws ClassCastException?

A.

line 18

B.

line 17

C.

line 19

D.

line 16

Full Access
Question # 12

Given the code fragment:

1z0-808 question answer

Which two code fragments inserted at line 10 print ****?

1z0-808 question answer

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 13

Given the code fragment:

1z0-808 question answer

What is the result?

A.

3142

B.

2413

C.

1324

D.

4231

Full Access
Question # 14

Given this code for a Planet object:

1z0-808 question answer

What is the output?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 15

Which one of the following code examples uses valid Java syntax?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 16

Given the code fragment:

1z0-808 question answer

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 # 17

Given the following main method:

1z0-808 question answer

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 # 18

Given:

1z0-808 question answer

And given the code fragment:

1z0-808 question answer

What is the result?

A.

C2C2

B.

C1C2

C.

C1C1

D.

Compilation fails

Full Access
Question # 19

Given this class:

1z0-808 question answer

Which two changes would encapsulate this class and ensure that the area field is always equal to length * height whenever the Rectangle class is used?

A.

Call the setArea method at the end of the setHeight method.

B.

Call the setArea method at the beginning of the setHeight method.

C.

Call the setArea method at the end of the setLength method.

D.

Call the setArea method at the beginning of the setLength method.

E.

Change the setArea method to private.

F.

Change the area field to public.

Full Access
Question # 20

Given the code fragment:

1z0-808 question answer

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 # 21

Given the code fragment:

1z0-808 question answer

Which action enables the code to print Helping… Done?

A.

replace class Humanoid extends Robot {

with abstract class Humanoid extends Robot {

B.

replace interface Speakable {

with abstract class Speakable

C.

replace public void process();

with public abstract void process();

D.

replace abstract class Robot implements Speakable {

with class Robot extends Speakable {

Full Access
Question # 22

Given:

1z0-808 question answer

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 # 23

Given the code fragment:

1z0-808 question answer

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

A.

String str2 = str1;

B.

String str2 = new String(str1);

C.

String str2 = sb1. toString();

D.

String str2 = "Duke";

Full Access
Question # 24

Given the code fragments:

1z0-808 question answer

And:

1z0-808 question answer

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 # 25

Given the code fragments:

1z0-808 question answer

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 # 26

Given:

1z0-808 question answer

What is the result?

A.

An exception is thrown at runtime.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails.

Full Access
Question # 27

Given the code fragment:

1z0-808 question answer

Which two modifications should you make so that the code compiles successfully? (Choose two.)

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 28

Examine the given definitions:

1z0-808 question answer

and the code fragment:

1z0-808 question answer

Which statement is true about the implementation of Object-Oriented Programming concepts in the given code?

A.

Polymorphism, abstraction, and encapsulation are implemented.

B.

Only polymorphism and inheritance are implemented.

C.

Polymorphism, inheritance, and abstraction are implemented.

D.

Only inheritance and encapsulation are implemented.

Full Access
Question # 29

Which is true about the switch statement?

A.

Its expression can evaluate to a collection of values.

B.

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

C.

Its case label literals can be changed at runtime.

D.

It must contain the default section.

Full Access
Question # 30

Given the code fragment:

1z0-808 question answer

What is the result?

A.

Answer = 0

B.

Invalid calculation

C.

Compilation fails only at line n1.

D.

Compilation fails only at line n2.

E.

Compilation fails at line n1 and line2.

Full Access
Question # 31

Given:

1z0-808 question answer

And given the code fragment:

Book book1 = new EBook();

book1.readBook();

Which option enables the code to compile?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 32

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 # 33

Given:

1z0-808 question answer

What is the result?

A.

BaseDerivedA

B.

BaseDerivedB

C.

DerivedBDerivedB

D.

DerivedBDerivedA

E.

A ClassCastException is thrown at runtime.

Full Access
Question # 34

Given:

1z0-808 question answer

And the code fragment:

1z0-808 question answer

What is the result?

A.

C1C2

B.

C1C1

C.

Compilation fails.

D.

C2C2

Full Access
Question # 35

Given:

1z0-808 question answer

Which code fragment can replace the if block?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 36

Given the code fragment:

1z0-808 question answer

What is the result?

A.

[green, red, yellow, cyan]

B.

[green, blue, yellow, cyan]

C.

[green, red, cyan, yellow]

D.

An IndexOutOfBoundsException is thrown at runtime.

Full Access
Question # 37

Given the code fragments:

1z0-808 question answer

Which code fragment, when inserted at line n1, enables the code to print Hank?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 38

Given the code fragment:

1z0-808 question answer

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

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 39

Given the code fragment:

1z0-808 question answer

What is the result?

A.

An exception is thrown at runtime.

B.

07-31-2014

C.

2014-07-31

D.

2014-09-30

Full Access
Question # 40

Given:

1z0-808 question answer

And given the code fragment:

1z0-808 question answer

What is the result?

A.

300:300200:300

B.

300:100200:300

C.

300:00:300

D.

100:300300:200

Full Access
Question # 41

Given the code fragment:

1z0-808 question answer

Which modification enables the code to print 54321?

A.

Replace line 6 with System.out.print (--x);

B.

At line 7, insert x --;

C.

Replace line 5 with while (is Available(--x)) {

D.

Replace line 12 with return (x > 0) ? false : true;

Full Access
Question # 42

Given the code fragment:

1z0-808 question answer

Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order? (Choose two.)

1z0-808 question answer

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 43

Given the code fragment:

1z0-808 question answer

What is the result?

A.

11

B.

10

C.

12

D.

A compile time error occurs.

Full Access
Question # 44

Which statement will empty the contents of a StringBuilder variable named sb?

A.

sb. deleteAll ();

B.

sb. delete (0, sb. size () );

C.

sb. delete (0, sb. length () );

D.

sb. removeAll ();

Full Access
Question # 45

Given:

1z0-808 question answer

What is the result?

A.

Area is 6.0

B.

Area is 3.0

C.

Compilation fails at line n1

D.

Compilation fails at line n2.

Full Access
Question # 46

Which statement is true about the main() method?

A.

It is invoked by JRE

B.

It is a final method

C.

It returns true if it is executed successfully at run time

D.

It must be defined within a public class

Full Access
Question # 47

Given the code fragment:

1z0-808 question answer

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 # 48

Given:

1z0-808 question answer

What is the result?

A.

null:null:0.0

B.

null:null

C.

<>:0.0

D.

null:0.0

Full Access
Question # 49

Given the code fragment:

1z0-808 question answer

What is the result?

A.

2 4

B.

0 2 4 6

C.

0 2 4

D.

Compilation fails

Full Access
Question # 50

Given:

1z0-808 question answer

and the code fragment:

S2 sobj = new S2(); sobj.display(10, 100);

What is the result?

A.

Child 10

Child 100

Parent 100

B.

Parent 10

Child 10

Parent 1000

C.

Child 10

Parent 100

Parent 100

D.

A compile time error occurs.

Full Access
Question # 51

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 # 52

Which two code fragments cause compilation errors? (Choose two.)

A.

double y1 = 203.22; float fit = y1;

B.

float fit = (float) 1_11.00;

C.

Float fit = 100.00;

D.

int y2 = 100;

float fit = (float) y2;

E.

float fit = 100.00F;

Full Access
Question # 53

Given the code fragment:

1z0-808 question answer

Which code fragment at line 10 prints Welcome 100?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 54

Given:

1z0-808 question answer

How many MarkList instances are created in memory at runtime?

A.

1

B.

2

C.

3

D.

4

Full Access
Question # 55

Given the code snippet from a compiled Java source file:

1z0-808 question answer

and this output:

1z0-808 question answer

Which command should you run to obtain this output?

A.

java MyFile 2

B.

java MyFile 1 2 3 4

C.

java MyFile 1 2 2

D.

java MyFile 2 2

Full Access
Question # 56

Given:

1z0-808 question answer

What is the result?

A.

Compilation fails at line n1.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails at line n2.

Full Access
Question # 57

Given:

1z0-808 question answer

What is the result?

A.

400 200

B.

200 200

C.

400 400

D.

Compilation fails.

Full Access
Question # 58

Given:

1z0-808 question answer

And given the code fragment:

1z0-808 question answer

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 # 59

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 # 60

Given this segment of code:

1z0-808 question answer

Which two statements, if either were true, would make the code compile? (Choose two.)

A.

MotorCycle is an interface that implements the Cycle class.

B.

Cycle is an interface that is implemented by the MotorCycle class.

C.

Cycle is an abstract superclass of MotorCycle.

D.

Cycle and MotorCycle both extend the Transportation superclass.

E.

Cycle and MotorCycle both implement the Transportation interface.

F.

MotorCycle is a superclass of Cycle.

Full Access
Question # 61

Given:

1z0-808 question answer

What is the result?

A.

true:true

B.

true:false

C.

false:true

D.

false:false

Full Access
Question # 62

Given:

1z0-808 question answer

Which two code fragments can be inserted at line n1?

A.

String str = “Java”;

B.

for(int iVal = 0; iVal <=5; iVal++){}

C.

Test() {}

D.

package p1;

E.

import java.io.*;

Full Access
Question # 63

Given the code fragment:

1z0-808 question answer

What is the result?

A.

EN FR JP

B.

EN FR

C.

CH

D.

EN FR CH

Full Access
Question # 64

Given the code fragment:

1z0-808 question answer

What is the result?

1z0-808 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Full Access
Question # 65

Given the code fragment:

1z0-808 question answer

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 # 66

Given the code fragment:

1z0-808 question answer

What is the result?

A.

It results in a compile time error at line 18.

B.

It results in a compile time error at line 9.

C.

It prints : 1

D.

It results in a compile time error at lines at lines 12 and 15.

Full Access
Question # 67

Given:

1z0-808 question answer

What is the result?

A.

A B C D

B.

A C D

C.

A C D D

D.

A B D

E.

A B D C

Full Access