QUESTION 101. Given: class RateOfInterest { public static void main (String[] args) { int rateOfInterest = 0;. String accountType = "LOAN"; switch (accountType) {.
New VCE and PDF Exam Dumps from PassLeader
➢ Vendor: Oracle ➢ Exam Code: 1Z0-809 ➢ Exam Name: Java SE 8 Programmer II ➢ Question 101 -- End Visit PassLeader and Download Full Version 1Z0-809 Exam Dumps QUESTION 101 Given: class RateOfInterest { public static void main (String[] args) { int rateOfInterest = 0; String accountType = "LOAN"; switch (accountType) { case "RD"; rateOfInterest = 5; break; case "FD"; rateOfInterest = 10; break; default: assert false: "No interest for this account";//line n1 } System.out.println ("Rate of interest:" + rateOfInterest); } } and the command: java -ea RateOfInterest What is the result? A. B. C. D.
Rate of interest: 0 An AssertionError is thrown No interest for this account A compilation error occurs at line n1
Answer: C 1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader QUESTION 102 Given:
What is the result? A. Marrown String out of limits JesOran B. Marrown String out of limits Array out of limits C. Marrown String out of limits D. Marrown NanRed JesOran Answer: A QUESTION 103 Given:
What is the result? A. 6 7 8 B. 7 8 9 C. 0 1 2 1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader D. 6 8 10 E. Compilation fails Answer: A QUESTION 104 Given: public class Foo { private K key; private V value; public Foo (K key, V value) (this.key = key; this value = value;) public static Foo twice (T value) (return new Foo (value, value); ) public K getKey () (return key;) public V getValue () (return value;) } Which option fails? A. B. C. D.
Foo mark = new Foo ("Steve", 100); Foo pair = Foo.twice ("Hello World!"); Foo percentage = new Foo (97, 32); Foo grade = new Foo ("John", "A");
Answer: C QUESTION 105 Given: Item table ID, INTEGER: PK DESCRIP, VARCHAR(100) PRICE, REAL QUANTITY And given the code fragment: 9. try { 10.Connection conn = DriveManager.getConnection(dbURL, username, password); 11. String query = “Select * FROM Item WHERE ID = 110”; 12. Statement stmt = conn.createStatement(); 13. ResultSet rs = stmt.executeQuery(query); 14.while(rs.next()) { 15.System.out.println(“ID:“ + rs.getInt(“Id”)); 16.System.out.println(“Description:“ + rs.getString(“Descrip”)); 17.System.out.println(“Price:“ + rs.getDouble(“Price”)); 18. System.out.println(Quantity:“ + rs.getInt(“Quantity”)); 19.} 20. } catch (SQLException se) { 21. System.out.println(“Error”); 22. } Assume that: - The required database driver is configured in the classpath. - The appropriate database is accessible with the dbURL, userName, and passWord exists. - The SQL query is valid. What is the result? 1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader A. B. C. D.
An exception is thrown at runtime. Compilation fails. The code prints Error. The code prints information about Item 110.
Answer: C QUESTION 106 Given the definition of the Country class: public class country { public enum Continent {ASIA, EUROPE} String name; Continent region; public Country (String na, Continent reg) { name = na, region = reg; } public String getName () {return name;} public Continent getRegion () {return region;} } and the code fragment: List couList = Arrays.asList ( new Country (“Japan”, Country.Continent.ASIA), new Country (“Italy”, Country.Continent.EUROPE), new Country (“Germany”, Country.Continent.EUROPE)); Map regionNames = couList.stream () .collect(Collectors.groupingBy (Country ::getRegion, Collectors.mapping(Country::getName, Collectors.toList())))); System.out.println(regionNames); What is the output? A. B. C. D.
{EUROPE = [Italy, Germany], ASIA = [Japan]} {ASIA = [Japan], EUROPE = [Italy, Germany]} {EUROPE = [Germany, Italy], ASIA = [Japan]} {EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}
Answer: A QUESTION 107 Given the code fragment:
Which code fragments, inserted independently, enable the code compile? A. t.fvar = 200; B. cvar = 400; 1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader C. fvar = 200; cvar = 400; D. this.fvar = 200; this.cvar = 400; E. t.fvar = 200; Test2.cvar = 400; F. this.fvar = 200; Test2.cvar = 400; Answer: B QUESTION 108 Which two statements are true for a two-dimensional array? A. B. C. D.
It is implemented as an array of the specified element type. Using a row by column convention, each row of a two-dimensional array must be of the same size. At declaration time, the number of elements of the array in each dimension must be specified. All methods of the class Object may be invoked on the two-dimensional array.
Answer: AD QUESTION 109 Given the definition of the Vehicle class: class Vehicle { String name; void setName (String name) { this.name = name; } String getName() { return name; } } Which action encapsulates the Vehicle class? A. B. C. D. E. F.
Make the Vehicle class public. Make the name variable public. Make the setName method public. Make the name variable private. Make the setName method private. Make the getName method private.
Answer: B QUESTION 110 Given:
1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader
What is the result? A. hEllOjAvA! B. Hello java! C. Out of limits hEllOjAvA! D. Out of limits Answer: C QUESTION 111 Given: public class Counter { public static void main (String[ ] args) { int a = 10; int b = -1; assert (b >=1) : "Invalid Denominator"; int = a / b; System.out.println (c); } } What is the result? A. B. C. D.
-10 0 An AssertionError is thrown A compilation error occurs
Answer: B QUESTION 112 Given: public interface Moveable { public default void walk {System.out.println("Walking");) public void run(Integer distance); } Which statement is true?
(Integer
distance)
A. Moveable can be used as below: 1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html
New VCE and PDF Exam Dumps from PassLeader Moveable animal = n - > System.out.println("Running" + n); animal.run(100); animal.walk(20); B. Moveable can be used as below: Moveable animal = n - > n + 10; animal.run(100); animal.walk(20); C. Moveable can be used as below: Moveable animal = (Integer n) - > System.out.println(n); animal.run(100); Moveable.walk(20); D. Movable cannot be used in a lambda expression Answer: ......
Visit PassLeader and Download Full Version 1Z0-809 Exam Dumps
1Z0-809 Exam Dumps 1Z0-809 Exam Questions 1Z0-809 VCE Dumps 1Z0-809 PDF Dumps https://www.passleader.com/1z0-809.html