Labour Day Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: scxmas70

1z0-811 Exam Dumps - Java Foundations

Question # 4

What is the meaning of “write once, run anywhere” in Java?

A.

Java programs are designed to run only in web browsers and, thus, can run wherever there is a browser.

B.

It is a marketing statement because Java programs must be compiled for a specific platform in order to run.

C.

Java programs can run on any Java Virtual Machine without being recompiled.

D.

Java programs, after being compiled, can run on any platform or device even without a Java Virtual Machine.

Full Access
Question # 5

Given the code fragment:

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

A.

new int num[];

B.

int[] num;

C.

int[10] num;

D.

int num[10];

Full Access
Question # 6

Which package would you import to use the Random class?

A.

java.io

B.

java.math

C.

java.util

D.

java.lang

Full Access
Question # 7

Given the code fragment:

What is the result?

A.

10

B.

11

C.

12

D.

13

Full Access
Question # 8

Given:

What is the result?

A.

300

B.

100

C.

200

D.

A compilation error occurs.

Full Access
Question # 9

Given the code fragment:

Which two code fragments are valid at line 2?

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);

}

Full Access
Question # 10

Given the code fragment:

What is the result?

A.

false

false

B.

true

true

C.

true

false

D.

false

true

Full Access
Question # 11

Given the code fragment:

What is the result?

A.

456789

B.

4567889

C.

45678

D.

3456789

Full Access