Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ecus65

Oracle 1z0-811 - Java Foundations

Page: 2 / 3
Total 75 questions

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

}

Given:

What is the result?

A.

The program compiles and nothing is printed.

B.

Iteration plus an increasing number is printed 100 times.

C.

Iteration plus an increasing number is printed 99 times.

D.

An error occurs during compilation.

Given the code:

Which code fragment, when inserted at line n1, enables the code to print sum is 30?

A.

int sum(int a, b) {

B.

int sum(int a, int b) {

C.

int sum(int, int) {

D.

int sum(int[] a, b) {

Identify three features of the Java programming language.

A.

distributed

B.

direct memory management

C.

multithreaded

D.

strongly typed

E.

dynamically typed

Given the code fragment:

What is the result?

A.

Selected null flavor.

B.

Selected Chocolate flavor.

C.

An ArrayIndexOutofBoundsException is thrown at run time.

D.

Selected Chocolate flavor.

Thank you!

Given the code fragment:

What is the result?

A.

false

true

B.

true

true

C.

false

false

D.

A runtime exception is thrown

Which statement is true about primitive variables?

A.

They can be compared with the == operator.

B.

They can be compared with the equals method only.

C.

They cannot be compared.

D.

They can be compared with the compareTo method only.

Given:

At which line does a compilation error occur?

A.

line 5

B.

line 2

C.

line 3

D.

line 7

Given the code fragment:

Which statement is true?

A.

The code results in a compilation error. To make it compile, insert at line n1:

import java.lang.Math;

import java.lang.Random;

B.

The code compiles successfully

C.

The code results in a compilation error. To make it compile, insert at line n1:

import java.lang;

import java.util;

D.

The code results in a compilation error. To make it compile, insert at line n1:

import java.util.*;

You have a microprocessor board, such as Raspberry PI, wired to control a drone.

Which edition of Java is geared towards use of simple, closed systems with constrained memory requirements, such as a microprocessor board?

A.

Java Micro Edition

B.

Java Standard Edition with a Compact Profile

C.

Java Enterprise Edition

D.

Java SE Embedded