Labour Day - Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dpm65

1z0-811 Java Foundations Questions and Answers

Questions 4

Given the code fragment:

1z0-811 Question 4

Which two code fragments are valid at line 2?

Options:

A.

for (int count = 0; count < 5; count++) {

System.out.print(count);

}

B.

package p1;

C.

import java.util.*;

public void display() {

List nums = new ArrayList<> ();

}

D.

{

private int num;

}

E.

private String name = “John”;

public void display() {

System.out.print(name);

}

Buy Now
Questions 5

Given the contents of the Test.java file:

1z0-811 Question 5

What is the result?

Options:

A.

200 : 400

B.

A compilation error occurs at line n1.

C.

A compilation error occurs at line n2.

D.

100 : 400

Buy Now
Questions 6

Given the code fragment:

1z0-811 Question 6

Which statement, when inserted at line n1, enables the code to print 0 2 4 6 8 10?

Options:

A.

count = (count++) +1;

B.

count = count++;

C.

count =+ 2;

D.

count += 2;

Buy Now
Questions 7

What does import java.io* mean?

Options:

A.

Only the io class is imported.

B.

All classes in the io package are imported.

C.

All classes whose names start with io are imported.

D.

All classes in the io package and the subpackages of io packages, if any, are imported.

Buy Now
Questions 8

Given:

1z0-811 Question 8

At which line does a compilation error occur?

Options:

A.

line 5

B.

line 2

C.

line 3

D.

line 7

Buy Now
Questions 9

Given:

1z0-811 Question 9

What is the result?

Options:

A.

Compilation fails. To make it compile, replace line n1 with var1 = 0;

B.

Compilation fails. To make it compile, replace line n2 with var2 = 0;

C.

0

D.

Nothing is printed.

Buy Now
Questions 10

Which two components can class declarations include?

Options:

A.

A list of instance methods

B.

The main method

C.

Interfaces implemented by the class

D.

The public modifier

Buy Now
Questions 11

Given the code fragment:

1z0-811 Question 11

Which code fragment can be inserted at line n1 to enable the code to print 0.0?

Options:

A.

Ball b = null;

B.

weight = 0.0;

C.

Ball.weight = 0.0;

D.

Ball b = new Ball(0.0);

E.

Ball b = new Ball();

Buy Now
Exam Code: 1z0-811
Exam Name: Java Foundations
Last Update: Apr 22, 2024
Questions: 75

PDF + Testing Engine

$56  $159.99

Testing Engine

$42  $119.99
buy now 1z0-811 testing engine

PDF (Q&A)

$35  $99.99
buy now 1z0-811 pdf
dumpsmate guaranteed to pass
24/7 Customer Support

DumpsMate's team of experts is always available to respond your queries on exam preparation. Get professional answers on any topic of the certification syllabus. Our experts will thoroughly satisfy you.

Site Secure

mcafee secure

TESTED 28 Apr 2024