Your success in java se 8 programmer ii 1z0 809 is our sole target and we develop all our java se 8 programmer ii 1z0 809 in a way that facilitates the attainment of this target. Not only is our java se 8 programmer ii 1z0 809 material the best you can find, it is also the most detailed and the most updated. java se 8 programmer ii 1z0 809 for Oracle 1Z0-809 are written to the highest standards of technical accuracy.

Online 1Z0-809 free questions and answers of New Version:

NEW QUESTION 1
Given the code fragments:
4. void doStuff() throws ArithmeticException, NumberFormatException, Exception
{
5. if (Math.random() >-1 throw new Exception (“Try again”); 6. }
and
24. try {
25. doStuff ( ):
26. } catch (ArithmeticException | NumberFormatException | Exception e) {
27. System.out.println (e.getMessage()); }
28. catch (Exception e) {
29. System.out.println (e.getMessage()); }
30. }
Which modification enables the code to print Try again?

  • A. Comment the lines 28, 29 and 30.
  • B. Replace line 26 with:} catch (Exception | ArithmeticException | NumberFormatException e) {
  • C. Replace line 26 with:} catch (ArithmeticException | NumberFormatException e) {
  • D. Replace line 27 with: throw e;

Answer: C

NEW QUESTION 2
Given the code fragment:
String str = “Java is a programming language”; ToIntFunction<String> indexVal = str: : indexOf; //line n1 int x = indexVal.applyAsInt(“Java”); //line n2
System.out.println(x); What is the result?

  • A. 1
  • B. A compilation error occurs at line n1.
  • C. A compilation error occurs at line n2.

Answer: A

NEW QUESTION 3
Given:
1Z0-809 dumps exhibit
What is the result?

  • A. IT:null
  • B. A NullPointerException is thrown at run time.
  • C. A compilation error occurs.
  • D. IT:0.0

Answer: D

NEW QUESTION 4
Given:
class Vehicle { int vno;
String name;
public Vehicle (int vno, String name) { this.vno = vno,;
this.name = name;
}
public String toString () { return vno + “:” + name;
}
}
and this code fragment:
Set<Vehicle> vehicles = new TreeSet <> (); vehicles.add(new Vehicle (10123, “Ford”)); vehicles.add(new Vehicle (10124, “BMW”)); System.out.println(vehicles);
What is the result?

  • A. 10123 Ford10124 BMW
  • B. 10124 BMW10123 Ford
  • C. A compilation error occurs.
  • D. A ClassCastException is thrown at run time.

Answer: D

NEW QUESTION 5
Given the code fragment:
1Z0-809 dumps exhibit
Which is the valid definition of the Course enum?
1Z0-809 dumps exhibit
1Z0-809 dumps exhibit

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D

Answer: A

NEW QUESTION 6
Given the definition of the Emp class: public class Emp
private String eName; private Integer eAge;
Emp(String eN, Integer eA) { this.eName = eN;
this.eAge = eA;
}
public Integer getEAge () {return eAge;} public String getEName () {return eName;}
}
and code fragment:
List<Emp>li = Arrays.asList(new Emp(“Sam”, 20), New Emp(“John”, 60), New Emp (“Jim”, 51));
Predicate<Emp> agVal = s -> s.getEAge() > 50; //line n1 li = li.stream().filter(agVal).collect(Collectors.toList());
Stream<String> names = li.stream()map.(Emp::getEName); //line n2 names.forEach(n -> System.out.print(n + “ “));
What is the result?

  • A. Sam John Jim
  • B. John Jim
  • C. A compilation error occurs at line n1.
  • D. A compilation error occurs at line n2.

Answer: B

NEW QUESTION 7
Given the code fragment:
1Z0-809 dumps exhibit
Which should be inserted into line n1 to print Average = 2.5?

  • A. IntStream str = Stream.of (1, 2, 3, 4);
  • B. IntStream str = IntStream.of (1, 2, 3, 4);
  • C. DoubleStream str = Stream.of (1.0, 2.0, 3.0, 4.0);
  • D. Stream str = Stream.of (1, 2, 3, 4);

Answer: C

NEW QUESTION 8
Given the code fragments:
1Z0-809 dumps exhibit
and
1Z0-809 dumps exhibit
What is the result?

  • A. FranceOptional[NotFound]
  • B. Optional [France] Optional [NotFound]
  • C. Optional[France] Not Found
  • D. FranceNot Found

Answer: D

NEW QUESTION 9
Given:
public class Emp { String fName; String lName;
public Emp (String fn, String ln) { fName = fn;
lName = ln;
}
public String getfName() { return fName; } public String getlName() { return lName; }
}
and the code fragment: List<Emp> emp = Arrays.asList ( new Emp (“John”, “Smith”),
new Emp (“Peter”, “Sam”),
new Emp (“Thomas”, “Wale”)); emp.stream()
//line n1
.collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName?

  • A. .sorted (Comparator.comparing(Emp::getfName).reserved().thenComparing(Emp::getlName))
  • B. .sorted (Comparator.comparing(Emp::getfName).thenComparing(Emp::getlName))
  • C. .map(Emp::getfName).sorted(Comparator.reserveOrder())
  • D. .map(Emp::getfName).sorted(Comparator.reserveOrder().map (Emp::getlName).reserved

Answer: A

NEW QUESTION 10
Given:
1Z0-809 dumps exhibit
and the code fragment:
1Z0-809 dumps exhibit
What is the result?

  • A. A compilation error occurs at line n1.
  • B. An Exception is thrown at run time.
  • C. 2

Answer: B

NEW QUESTION 11
Given the code fragment:
List<String> listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”); System.out.println (
// line n1
);
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?

  • A. listVal.stream().filter(x -> x.length()>3).count()
  • B. listVal.stream().map(x -> x.length()>3).count()
  • C. listVal.stream().peek(x -> x.length()>3).count().get()
  • D. listVal.stream().filter(x -> x.length()>3).mapToInt(x -> x).count()

Answer: A

NEW QUESTION 12
Given the code fragments: class Employee { Optional<Address> address;
Employee (Optional<Address> address) { this.address = address;
}
public Optional<Address> getAddress() { return address; }
}
class Address {
String city = “New York”;
public String getCity { return city: } public String toString() {
return city;
}
}
and
Address address = null;
Optional<Address> addrs1 = Optional.ofNullable (address);
Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : “City Not available”;
What is the result?

  • A. New York
  • B. City Not available
  • C. null
  • D. A NoSuchElementException is thrown at run time.

Answer: B

NEW QUESTION 13
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<Country> couList = Arrays.asList (
new Country (“Japan”, Country.Continent.ASIA), new Country (“Italy”, Country.Continent.EUROPE),
new Country (“Germany”, Country.Continent.EUROPE)); Map<Country.Continent, List<String>> regionNames = couList.stream ()
.c ollect(Collectors.groupingBy (Country ::getRegion, Collectors.mapping(Country::getName, Collectors.toList())))); System.out.println(regionNames);

  • A. {EUROPE = [Italy, Germany], ASIA = [Japan]}
  • B. {ASIA = [Japan], EUROPE = [Italy, Germany]}
  • C. {EUROPE = [Germany, Italy], ASIA = [Japan]}
  • D. {EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}

Answer: B

NEW QUESTION 14
Given:
public class Test<T> { private T t;
public T get () { return t;
}
public void set (T t) { this.t = t;
}
public static void main (String args [ ] ) { Test<String> type = new Test<>();
Test type 1 = new Test (); //line n1 type.set(“Java”);
type1.set(100); //line n2 System.out.print(type.get() + “ “ + type1.get());
}
}
What is the result?

  • A. Java 100
  • B. java.lang.string@<hashcode>java.lang.Integer@<hashcode>
  • C. A compilation error occur
  • D. To rectify it, replace line n1 with: Test<Integer> type1 = new Test<>();
  • E. A compilation error occur
  • F. To rectify it, replace line n2 with: type1.set (Integer(100));

Answer: A

NEW QUESTION 15
Given the code fragment:
ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 3, 0, 0, 0, ZoneID.of(“UTC-
7”));
ZonedDateTime arrive = ZonedDateTime.of(2015, 1, 15, 9, 0, 0, 0, ZoneID.of(“UTC-
5”));
long hrs = ChronoUnit.HOURS.between(depart, arrive); //line n1 System.out.println(“Travel time is” + hrs + “hours”);
What is the result?

  • A. Travel time is 4 hours
  • B. Travel time is 6 hours
  • C. Travel time is 8 hours
  • D. An exception is thrown at line n1.

Answer: A

NEW QUESTION 16
Given the code fragment:
Path p1 = Paths.get(“/Pics/MyPic.jpeg”); System.out.println (p1.getNameCount() + “:” + p1.getName(1) +
“:” + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?

  • A. An exception is thrown at run time.
  • B. 2:MyPic.jpeg: MyPic.jpeg
  • C. 1:Pics:/Pics/ MyPic.jpeg
  • D. 2:Pics: MyPic.jpeg

Answer: B

NEW QUESTION 17
Given the code fragment:
LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14); LocalDate nextYear = valentinesDay.plusYears(1); nextYear.plusDays(15); //line n1
System.out.println(nextYear); What is the result?

  • A. 2016-02-14
  • B. A DateTimeException is throw
  • C. 2016-02-29
  • D. A compilation error occurs at line n1.

Answer: A

NEW QUESTION 18
Given the code fragment: public class Foo {
public static void main (String [ ] args) {
Map<Integer, String> unsortMap = new HashMap< > ( ); unsortMap.put (10, “z”);
unsortMap.put (5, “b”);
unsortMap.put (1, “d”);
unsortMap.put (7, “e”);
unsortMap.put (50, “j”);
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new Comparator<Integer> ( ) {
@Override public int compare (Integer o1, Integer o2) {return o2.compareTo
(o1); } } );
treeMap.putAll (unsortMap);
for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) { System.out.print (entry.getValue () + “ “);
}
}
}
What is the result?

  • A. A compilation error occurs.
  • B. d b e z j
  • C. j z e b d
  • D. z b d e j

Answer: C

NEW QUESTION 19
You have been asked to create a ResourceBundle which uses a properties file to localize an application. Which code example specifies valid keys of menu1 and menu2 with values of File Menu and View Menu?

  • A. <key name = ‘menu1”>File Menu</key><key name = ‘menu2”>View Menu</key>
  • B. <key>menu1</key><value>File Menu</value><key>menu2</key><value>View Menu</value>
  • C. menu1, File Menu, menu2, View Menu Menu
  • D. menu1 = File Menu menu2 = View Menu

Answer: D

NEW QUESTION 20
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. Rate of interest: 0
  • B. An AssertionError is thrown.
  • C. No interest for this account
  • D. A compilation error occurs at line n1.

Answer: B

Recommend!! Get the Full 1Z0-809 dumps in VCE and PDF From Certstest, Welcome to Download: https://www.certstest.com/dumps/1Z0-809/ (New 155 Q&As Version)