0% found this document useful (0 votes)
405 views41 pages

Oracle - Pre .1z0-819.by .VCEplus.50q-DEMO

This document contains a 50 question practice exam for the 1z0-819 Java SE 11 Developer certification. It provides the exam questions, possible answer choices, and the correct answers. It also includes short explanations for some of the questions. The document includes the exam number, passing score, time limit, and links to the exam provider's website for additional information.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
405 views41 pages

Oracle - Pre .1z0-819.by .VCEplus.50q-DEMO

This document contains a 50 question practice exam for the 1z0-819 Java SE 11 Developer certification. It provides the exam questions, possible answer choices, and the correct answers. It also includes short explanations for some of the questions. The document includes the exam number, passing score, time limit, and links to the exam provider's website for additional information.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

1z0-819.VCEplus.premium.exam.

50q

Number: 1z0-819
Passing Score: 800
Time Limit: 120 min
File Version: 1.0

Website: https://vceplus.com - https://vceplus.co


VCE to PDF Converter: https://vceplus.com/vce-to-pdf/
Facebook: https://www.facebook.com/VCE.For.All.VN/
Twitter : https://twitter.com/VCE_Plus

1z0-819

Java SE 11 Developer

Version 1.0

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Exam A

QUESTION 1
Given:

What is the result?

A. 2-4
B. 0-6
1-5
2-4
C. 1-5
D. 1-5
2-4
E. The compilation fails due to an error in line 1.
F. 0-6
G.0-6
2-4

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 2
Given:

What is the result?

A. 5 4 3 2 1
B. 5
C. nothing
D. 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 3
Given:

and

Which two method definitions at line n1 in the Bar class compile? (Choose two.)

A. public List<Number> foo(Set<String> m) {...}


B. public List<Integer> foo(Set<CharSequence> m) {...}
C. public List<Integer> foo(TreeSet<String> m) {...}
D. public List<Object> foo(Set<CharSequence> m) {...}
E. public ArrayList<Integer> foo(Set<String> m) {...}
F. public ArrayList<Number> foo(Set<CharSequence> m) {...} Correct Answer: CF

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation

Explanation/Reference:

QUESTION 4
Given:

What is the result?

A. 5
B. 4
C. 3
D. An exception is thrown at runtime

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 5
Given the code fragment:

What is the result?

A. 0 8 10
B. 0
C. The code prints nothing.
D. 0 4 9
E. 0 8
Correct Answer: E
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 6
Given the code fragment:

You want to display the value of currency as $100.00.

Which code inserted on line 1 will accomplish this?

A. NumberFormat formatter = NumberFormat.getInstance(locale).getCurrency();


B. NumberFormat formatter = NumberFormat.getCurrency(locale);
C. NumberFormat formatter = NumberFormat.getInstance(locale);
D. NumberFormat formatter = NumberFormat.getCurrencyInstance(locale);

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:
Reference: https://zetcode.com/java/numberformat/

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 7 Which three initialization statements are correct?
(Choose three.)

A. int[][][] e = {{1,1,1},{2,2,2}};
B. short sh = (short)’A’;
C. float x = 1f; D. byte b = 10; char c = b;
E. String contact# = “(+2) (999) (232)”;
F. int x = 12_34;
G.boolean false = (4 != 4);

Correct Answer: CBF


Section: (none)
Explanation

Explanation/Reference:
Reference: https://www.hudatutorials.com/java/basics/java-arrays/java-short-array

QUESTION 8
Your organization makes mlib.jar available to your cloud customers. While working on a new feature for mlib.jar, you see that the customer visible method

public void enableService(String hostName, String portNumber)

executes this code fragment

and you see this grant is in the security policy file:

What security vulnerability does this expose to your cloud customer's code?

A. privilege escalation attack against the OS running the customer code


B. SQL injection attack against the specified host and port
C. XML injection attack against any mlib server
D. none because the customer code base must also be granted SocketPermission
E. denial of service attack against any reachable machine

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:
QUESTION 9
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and

What is the result?

A. Joe
null
B. null
Mary
C. Joe
Marry
D. null
null

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 10
Given:

What is the result?

A. [A, B, C]
followed by an exception thrown on line 11.
B. [A, B, C] [A, B]
C. [A, B, C]
[A, B, C]
D. On line 9, an exception is thrown at run time.

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 11 Which module-info.java is correct for a service provider for a print service defined in the
PrintServiceAPI module?

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
A. module PrintServiceProvider {
requires PrintServiceAPI; exports
org.printservice.spi;
}
B. module PrintServiceProvider {
requires PrintServiceAPI; provides
org.printservice.spi.Print with
com.provider.PrintService;
}
C. module PrintServiceProvider {
requires PrintServiceAPI; uses
com.provider.PrintService;
}
D. module PrintServiceProvider {
requires PrintServiceAPI; exports
org.printservice.spi.Print with
com.provider.PrintService;
}

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 12
Given the code fragment:

What is the result?

A. EUR -> 0.84


GBP -> 0.75
USD -> 1.00
CNY -> 6.42
B. The compilation
fails.
C. CNY -> 6.42
EUR -> 0.84
GBP -> 0.75
USD -> 1.00

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. USD -> 1.00
GBP -> 0.75
EUR -> 0.84
CNY -> 6.42

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 13 Why would you choose to use a peek operation instead of a forEach operation
on a Stream?

A. to process the current item and return void


B. to remove an item from the end of the stream
C. to process the current item and return a stream
D. to remove an item from the beginning of the stream

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:
Reference: https://www.baeldung.com/java-streams-peek-api

QUESTION 14
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
What is the result?

A. abcd
B. The compilation fails.
C. adf
D. abd
E. abdf

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 15 Given the code fragment: List<Integer>
list = List.of(11,12,13,12,13);

Which statement causes a compile time error?

A. Double d = list.get(0);
B. double f = list.get(0);
C. Integer a = Integer.valueOf(list.get(0));
D. Integer b = list.get(0);
E. int c =list.get(0);
F. Double e = Double.valueOf(list.get(0));

Correct Answer: C

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation

Explanation/Reference:

QUESTION 16
Given:

and

Which two are valid usages of the annotation? (Choose two.)

A. @Meal(mainCourse=”pizza”)
@Meal(dessert=”pudding”)
public class Main {
}
B. @Meal(mainCourse=null)
public class Main {
}
C. @Meal(starter=”snack”,
dessert=”ice cream”) public
class Main {
}
D. @Meal(mainCourse=”pizza”)
@Meal(mainCourse=”salad”)
public class Main {
}
E. @Meal(mainCourse=”pizza”,
starter=”snack”,
dessert=”pudding”) public
class Main {
}

Correct Answer: BE
Section: (none)
Explanation

Explanation/Reference:

QUESTION 17
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the code fragment:

Which three code fragments, at line n1, prints SPRING? (Choose three.)

A. System.out.println(Season.valueOf(“SPRING”).ordinal());
B. System.out.println(Season.values(1));
C. System.out.println(Season.SPRING);
D. System.out.println(Season.valueOf(“SPRING”));
E. System.out.println(Season.valueOf(‘s’));
F. System.out.println(sA[0]);
G.System.out.println(sA[1]);

Correct Answer: BCE


Section: (none)
Explanation

Explanation/Reference:

QUESTION 18
Given:

Which two lines of code when inserted in line 1 correctly modifies instance variables? (Choose two.)

A. cCount = setCCount(c);
B. setCCount(c) = cCount;

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
C. setGCount(g);
D. tCount = tCount;
E. aCount = a;

Correct Answer: BD
Section: (none)
Explanation

Explanation/Reference:

QUESTION 19
Given:

and

and

You want to print the message こんにちは Joe, 宜しくお願いします, Jane.

Which code inserted on line 1 will accomplish this?

A. ResourceBundle msg = ResourceBundle.getBundle(“/proj/msg/messages”, new Locale(“ja”,“JP”));


Object[] names = “Joe”, “Jane”);
String message = MessageFormat.format(msg.getString(“message”),names);
B. ResourceBundle msg = ResourceBundle.getBundle(“msg.messages”, Locale.JAPAN); Object[] names = “Joe”,
“Jane”);
String message = MessageFormat.format(msg.getString(“message”),names);
C. Locale.setDefault(Locale.JAPAN);
ResourceBundle messages = ResourceBundle.getBundle(“messages”);
String message = MessageFormat.format(msg.getString(“message”),“Joe”,“Jane”);
D. ResourceBundle msg = ResourceBundle.getBundle(“messages”, Locale.JAPAN); String[] names = “Joe”,
“Jane”);
String message = MessageFormat.format(msg.getString(“message”),names);

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:

QUESTION 20
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the commands:

What is the result on execution of these commands?

A. Test.class - > java.sql -> java.base


B. On execution, the jdeps command displays an error.
C. Test.class -> java.base
Test.class - > java.sql
D. Test.class -> java.base Test.class - > java.sql java.sql -> java.base

Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:

QUESTION 21
A company has an existing Java 8 jar file, sales-app-1.1.1.jar, that uses several Apache open source jar files that have not been modularized.

Which module-info.java file should be used to convert sales-app-1.1.jar to a module?

A. module com.company.sales_app {
requires commons.beanutils; requires
org.apache.commons.collections4;
requires org.apache.commons.lang3;
requires org.apache.commons.text;
}
B. module com.company.sales_app {
requires org.apache.commons.beanutils;
requires
org.apache.commons.collections4;
requires org.apache.commons.lang3;
requires org.apache.commons.text;
}
C. module com.company.sales_app {
requires commons.beanutils; requires
commons.collections4; requires
commons.lang3; requires commons.text;
}

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. module com.company.sales_app {
requires commons.beanutils-1.9.3;
requires commons.collections4-4.2;
requires commons.lang3-3.8.1; requires
commons.text-1.3;
}

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 22 Which two are valid statements?


(Choose two.)

A. BiPredicate<Integer, Integer> test = (final Integer x, var y) -> (x.equals(y));


B. BiPredicate<Integer, Integer> test = (var x, final var y) -> (x.equals(y));
C. BiPredicate<Integer, Integer> test = (Integer x, final var y) -> (x.equals(y));
D. BiPredicate<Integer, Integer> test = (final var x, y) -> (x.equals(y));
E. BiPredicate<Integer, Integer> test = (Integer x, final Integer y) -> (x.equals(y));

Correct Answer: CE
Section: (none)
Explanation

Explanation/Reference:

QUESTION 23
Given:

and

What is the result?

A. Mr. Green
B. Green
C. An exception is thrown at runtime.
D. Mr. Blue
Correct Answer: C

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 24
Given:

It is required that if p instanceof Pair then p.isValid() returns true.

Which is the smallest set of visibility changes to insure this requirement is met?

A. left, right, setLeft, and setRight must be private.


B. setLeft and setRight must be protected.
C. left and right must be private.
D. isValid must be public.

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:
QUESTION 25

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
You want to read data through the reader object.

Which statement inserted on line 1 will accomplish this?

A. characters = reader.read();
B. reader.readLine();
C. characters.read();
D. reader.read(characters);

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:
Reference: https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html

QUESTION 26
Given:

and

Which four identifiers from the Foo and Bar classes are visible at line 1? (Choose four.)

A. e
B. f
C. A

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. j
E.
d
F.
c
G.
i
H.
B
I. h
J. g

Correct Answer: CFHJ


Section: (none)
Explanation

Explanation/Reference:

QUESTION 27
Which code fragment represents a valid Comparator implementation? A.

B. C.

D.

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 28
Given the code fragment:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Which statement is true?

A. It never finishes.
B. The action of CyclicBarrier is called five times.
C. It finishes without any exception.
D. Threads in executorService execute for each of the two threads.

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 29
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
What prevents this code from compiling?

A. The calculateSurfaceArea method within Cylinder must be declared default.


B. Cylinder is not properly calling the Rectangle and Ellipse interfaces’ calculateSurfaceArea methods.
C. Cylinder requires an implementation of calculateSurfaceArea with two parameters.
D. The calculateSurfaceArea method within Rectangle and Ellipse requires a public access modifier.

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:

QUESTION 30
Given a Member class with fields for name and yearsMembership, including getters and setters and a print method, and a list of clubMembers members:

Which two Stream methods can be changed to use method references? (Choose two.)

A. .filter(Integer::equals(0))
B. .map(testName::compareToIgnoreCase)
C. .filter(Member::getYearsMembership() >= testMembershipLength)

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. .peek(Member::print)

Correct Answer: BC
Section: (none)
Explanation

Explanation/Reference:

QUESTION 31
Given:

Path p1 = Paths.get(“/scratch/exam/topsecret/answers”);
Path p2 = Paths.get(“/scratch/exam/answers/temp.txt”);
Path p3 = Paths.get(“/scratch/answers/topsecret”);

Which two statements print ..\..\..\answers\topsecret? (Choose two.)

A. System.out.print(p3.relativize(p1));
B. System.out.print(p2.relativize(p3));
C. System.out.print(p1.relativize(p3));
D. System.out.print(p3.relativize(p2));
E. System.out.print(p1.relativize(p2));
F. System.out.print(p2.relativize(p1));

Correct Answer: AC
Section: (none)
Explanation

Explanation/Reference:

QUESTION 32
Given the code fragment:

Which fields are serialized in a Student object?

A. studentNo and classes


B. studentNo and name
C. studentNo, classes and name
D. studentNo, classes, name, and address

Correct Answer: A
Section: (none)
Explanation

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Explanation/Reference:

QUESTION 33
Given:

What is the output?

A. banana orange apple lemon


----apple banana lemon
orange
----B. ----banana orange
apple lemon ----apple banana
lemon orange C. -----
----D.
--------
-
banana orange apple lemon apple banana lemon orange
E. banana orange apple lemon apple banana lemon orange
-----
-----

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 34

and

What is the output?

A. Bonjour le monde! Bonjour le monde!


B. Hello world!
Hello world!
C. Hello world!
Bonjour le monde!
D. Bonjour le monde! Hello world!

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Correct Answer: C
Section: (none)
Explanation

Explanation/Reference:

QUESTION 35
Given:

What is true?

A. A NoSuchElementException is thrown at run time.


B. The compilation fails.
C. This should print the same result each time the program runs.
D. This may not print the same result each time the program runs.

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 36
Given:

What is the result?

A. The compilation fails.


B. [0). D, | 1). i, | 2). a]
C. [). o, | 1). a, | 2).]
D. [0). o, | 1). i, | 2). r]

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
E. ArrayIndexOutOfBounds Exception is thrown at runtime.

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 37
Given:

What is the result?

A. An exception is thrown at runtime.


B. -3
C. -2
D. The compilation fails.

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 38
Given the code fragment:

You must make the count variable thread safe.

Which two modifications meet your requirement? (Choose two.)

A. replace line 2 with public static synchronized void main(String[] args) {


B. replace line 1 with private volatile int count = 0; C. replace line 3 with
synchronized(test) {
test.count++; }
D. replace line 1 with private AtomicInteger count = new AtomicInteger(0); and replace line 3 with test.count.incrementAndGet();
E. replace line 3 with
synchronized(test.count) {
test.count++;
}
Correct Answer: DE

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation

Explanation/Reference:
Reference: https://stackoverflow.com/questions/15852123/java-thread-safe-counter/15852164

QUESTION 39
Given the code fragment:

Which action enables Computator class to compile?

A. change Line 1 to add throws NumberFormatException


B. change Line 3 to Double sum = 0.0;
C. change Line 5 to List<Double> numbers = List.of(5, 4, 6, 3, 7, 2, 8, 1, 9);
D. change Line 2 to public Double sum ( C collection) {
E. change Line 4 to for (Double n : collection) {

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:

QUESTION 40
Given the code fragment:

What is the result?

A. The compilation fails due to an error in line 2.


B. 201 C. de
D. 203
E. The compilation fails due to an error in line 3. F. The compilation fails due to an error in line 1.

Correct Answer: E

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 41 Given the


code fragment:

public void foo(Function<Integer, String> fun) {...}

Which two compile? (Choose two.)

A. foo( n -> Integer.toHexString(n) )


B. foo( toHexString )
C. foo( n -> n + 1 )
D. foo( int n -> Integer.toHexString(n) )
E. foo( n -> Integer::toHexString )
F. foo( Integer::toHexString )
G.foo( n::toHexString )
H. foo( (int n) -> Integer.toHexString(n) )

Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 42 Which declaration of an
annotation type is legal?

A. @interface Author {
String name() default “”;
String date();
}
B. @interface Author extends Serializable {
String name() default “”;
String date();
}
C. @interface Author {
String name() default null;
String date();
}
D. @interface Author {
String name();
String date;
}
E. @interface Author {
String name();
String date default “”;
}

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 43
Given:

and

and

What is the result?

A. The program prints Process()called 2.


B. A java.lang.NoSuchMethodException is thrown.
C. The program prints Process()called 1.

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. A java.lang.IllegalAccessException is thrown.
E. The compilation fails.

Correct Answer: E
Section: (none)
Explanation

Explanation/Reference:

QUESTION 44
Given:

Which two interfaces can be used in lambda expressions? (Choose two.)

A. MyInterface4
B. MyInterface5
C. MyInterface1
D. MyInterface3
E. MyInterface2

Correct Answer: DE
Section: (none)
Explanation

Explanation/Reference:

QUESTION 45
Given:

and

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and

What is the result?

A. Good Night, Harry


B. Good Morning, Potter
C. Good Morning, Harry
D. Good Night, Potter

Correct Answer: B
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 46

What is the result?


A. 357
B. 35
C. 235

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. 2357
E. An ArrayIndexOutOfBoundsException is thrown at runtime.

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:
Explanation:

QUESTION 47
Given:

Which line of code results in a compilation error?

A. line n1
B. line n3
C. line n2
D. line n4

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:
Explanation:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 48
Given the code fragment:

What is the result?

A. A java.lang.NullPointerException is thrown.
B. false
C. A java.lang.UnsupportedOperationException is thrown.
D. true

Correct Answer: A
Section: (none)
Explanation

Explanation/Reference:

QUESTION 49
Given:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the code fragment:

What is the result?

A. 9001: java.io.FileNotFoundException: MyFile.txt-MyFile.txt


B. 9001: APPLICATION ERROR-9001-MyFile.txt
9001: java.io.FileNotFoundException: MyFile.txt-MyFile.txt
C. 9001: APPLICATION ERROR-9001-MyFile.txt
D. Compilations fails at Line 1.

Correct Answer: D
Section: (none)
Explanation

Explanation/Reference:

QUESTION 50 Which two interfaces are considered to be functional interfaces?


(Choose two.)

A. @FunctionalInterface interface
InterfaceC { public boolean
equals(Object o); int
breed(int x); int
calculate(int x, int y);
}
B. @FunctionalInterface interface
InterfaceD { int breed(int x);

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
}
C. @FunctionalInterface interface
InterfaceE { public boolean
equals(int i); int breed(int
x);
}
D. interface InterfaceA { int
GERM = 13;
public default int getGERM() { return GERM; }
}
E. interface InterfaceB { int
GERM = 13; public default int
getGERM() { return get(); }
private int get() { return GERM;
} public boolean equals(Object
o); int breed(int x);
}

Correct Answer: AC
Section: (none)
Explanation

Explanation/Reference:

www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com

You might also like