Weekend Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple70

Pass the Oracle Java SE 1z0-830 Questions and answers with ExamsMirror

Practice at least 50% of the questions to maximize your chances of passing.
Exam 1z0-830 Premium Access

View all detail and faqs for the 1z0-830 exam


384 Students Passed

95% Average Score

98% Same Questions
Viewing page 1 out of 3 pages
Viewing questions 1-10 out of questions
Questions # 1:

Given:

java

String s = " ";

System.out.print("[" + s.strip());

s = " hello ";

System.out.print("," + s.strip());

s = "h i ";

System.out.print("," + s.strip() + "]");

What is printed?

Options:

A.

[ ,hello,h i]

B.

[,hello,h i]

C.

[,hello,hi]

D.

[ , hello ,hi ]

Questions # 2:

Given:

java

public class Test {

class A {

}

static class B {

}

public static void main(String[] args) {

// Insert here

}

}

Which three of the following are valid statements when inserted into the given program?

Options:

A.

A a = new A();

B.

B b = new Test.B();

C.

A a = new Test.A();

D.

B b = new Test().new B();

E.

B b = new B();

F.

A a = new Test().new A();

Questions # 3:

Given:

var cabarets = new TreeMap<>();

cabarets.put(1, "Moulin Rouge");

cabarets.put(2, "Crazy Horse");

cabarets.put(3, "Paradis Latin");

cabarets.put(4, "Le Lido");

cabarets.put(5, "Folies Bergère");

System.out.println(cabarets.subMap(2, true, 5, false));

What is printed?

Options:

A.

CopyEdit

{2=Crazy Horse, 3=Paradis Latin, 4=Le Lido, 5=Folies Bergère}

B.

{2=Crazy Horse, 3=Paradis Latin, 4=Le Lido}

C.

{}

D.

An exception is thrown at runtime.

E.

Compilation fails.

Questions # 4:

Given:

java

interface SmartPhone {

boolean ring();

}

class Iphone15 implements SmartPhone {

boolean isRinging;

boolean ring() {

isRinging = !isRinging;

return isRinging;

}

}

Choose the right statement.

Options:

A.

Iphone15 class does not compile

B.

Everything compiles

C.

SmartPhone interface does not compile

D.

An exception is thrown at running Iphone15.ring();

Questions # 5:

Given:

java

record WithInstanceField(String foo, int bar) {

double fuz;

}

record WithStaticField(String foo, int bar) {

static double wiz;

}

record ExtendingClass(String foo) extends Exception {}

record ImplementingInterface(String foo) implements Cloneable {}

Which records compile? (Select 2)

Options:

A.

ExtendingClass

B.

WithInstanceField

C.

ImplementingInterface

D.

WithStaticField

Questions # 6:

Given:

java

LocalDate localDate = LocalDate.of(2020, 8, 8);

Date date = java.sql.Date.valueOf(localDate);

DateFormat formatter = new SimpleDateFormat(/* pattern */);

String output = formatter.format(date);

System.out.println(output);

It's known that the given code prints out "August 08".

Which of the following should be inserted as the pattern?

Options:

A.

MM d

B.

MM dd

C.

MMMM dd

D.

MMM dd

Questions # 7:

Given:

java

var counter = 0;

do {

System.out.print(counter + " ");

} while (++counter < 3);

What is printed?

Options:

A.

0 1 2 3

B.

0 1 2

C.

1 2 3 4

D.

1 2 3

E.

An exception is thrown.

F.

Compilation fails.

Questions # 8:

Given:

java

var lyrics = """

Quand il me prend dans ses bras

Qu'il me parle tout bas

Je vois la vie en rose

""";

for ( int i = 0, int j = 3; i < j; i++ ) {

System.out.println( lyrics.lines()

.toList()

.get( i ) );

}

What is printed?

Options:

A.

vbnet

Quand il me prend dans ses bras

Qu'il me parle tout bas

Je vois la vie en rose

B.

Nothing

C.

An exception is thrown at runtime.

D.

Compilation fails.

Questions # 9:

Given:

java

sealed class Vehicle permits Car, Bike {

}

non-sealed class Car extends Vehicle {

}

final class Bike extends Vehicle {

}

public class SealedClassTest {

public static void main(String[] args) {

Class vehicleClass = Vehicle.class;

Class carClass = Car.class;

Class bikeClass = Bike.class;

System.out.print("Is Vehicle sealed? " + vehicleClass.isSealed() +

"; Is Car sealed? " + carClass.isSealed() +

"; Is Bike sealed? " + bikeClass.isSealed());

}

}

What is printed?

Options:

A.

Is Vehicle sealed? true; Is Car sealed? true; Is Bike sealed? true

B.

Is Vehicle sealed? false; Is Car sealed? false; Is Bike sealed? false

C.

Is Vehicle sealed? true; Is Car sealed? false; Is Bike sealed? false

D.

Is Vehicle sealed? false; Is Car sealed? true; Is Bike sealed? true

Questions # 10:

Given:

java

String textBlock = """

j \

a \t

v \s

a \

""";

System.out.println(textBlock.length());

What is the output?

Options:

A.

11

B.

12

C.

14

D.

10

Viewing page 1 out of 3 pages
Viewing questions 1-10 out of questions
TOP CODES

TOP CODES

Top selling exam codes in the certification world, popular, in demand and updated to help you pass on the first try.