Category Archives: Java SE 11 Developer 1Z0-819

Java SE 11 Developer 1Z0-819 Question and Answers

Given: (Exhibit) Which two allow a.Main to allocate a new Person? (Choose two.)

Given:Which two allow a.Main to allocate a new Person? (Choose two.) A. In Line 2, add extends Person to the Main classpublic class Main extends Person {and change Line 3 to create a new Main objectPerson person = new Main(); B. In Line 1, remove the access modifierPerson() { C. In Line 1, change the access modifier to… Read More »

Given an application with a main module that has this module-info.java file: (Exhibit) Which two are

Given an application with a main module that has this module-info.java file:Which two are true? (Choose two.) A. To run without an error, the application must have at least one module in the module path that provides an implementation of country.CountryDetails. B. A module providing an implementation of country.CountryDetails must have a requires main; directive in its module-info.java… Read More »

Given: (Exhibit) and omitting the throws FooException clause results in a compilation error. Which statement

Given:and omitting the throws FooException clause results in a compilation error.Which statement is true about FooException? A. FooException is unchecked. B. FooException is a subclass of RuntimeError. C. The body of foo can throw FooException or one of its subclasses. D. The body of foo can only throw FooException. Correct Answer: C

Consider this method declaration: (Exhibit) A) "SET SESSION AUTHORIZATION " + user B) "SET SESSION AUTHORIZATION

Consider this method declaration:A) “SET SESSION AUTHORIZATION ” + userB) “SET SESSION AUTHORIZATION ” + stmt.enquoteIdentifier(user)Is A or B the correct replacement for <EXPRESSION> and why? A. B, because all values provided by the calling code should be enquoted. B. A, because it is unnecessary to enclose identifiers in quotes. C. A, because it sends exactly the value… Read More »

A bookstore's sales are represented by a list of Sale objects populated with the name of the customer

A bookstore’s sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.public class Sale {private String customer;private List<Book> items;// constructor, setters and getters not shown}public class Book {private String name;private double price;// constructor, setters and getters not shown}Given a list of Sale objects, tList, which code fragment… Read More »

Assuming the Widget class has a getPrice method, this code does not compile: (Exhibit) Which two statements,

Assuming the Widget class has a getPrice method, this code does not compile:Which two statements, independently, would allow this code to compile? (Choose two.) A. Replace line 4 with Stream<Widget> widgetStream = widgets.stream();. B. Replace line 5 with widgetStream.filter(a > ((Widget)a).getPrice() > 20.00). C. Replace line 1 with List<Widget> widgetStream = widgets.stream();. D. Replace line 5 with widgetStream.filter((Widget… Read More »

Analyze the code: (Exhibit) Which two options can you insert inside println method to produce Global:namescope?

Analyze the code:Which two options can you insert inside println method to produce Global:namescope? (Choose two.) A. prefix+name B. Test.prefix+Test.name C. Test.getName+prefix D. new Test().prefix+new Test().name E. Test.prefix+Test.getName() F. prefix+Test.name Correct Answer: D,E