Oracle 1Z0-809 Exam (page: 3)
Oracle Java SE 8 Programmer II
Updated on: 29-Aug-2025

Viewing Page 3 of 35

Given the code fragment:

Stream<List<String>> iStr= Stream.of (
Arrays.asList (“1”, “John”),
Arrays.asList (“2”, null)0;
Stream<<String> nInSt = iStr.flatMapToInt ((x) -> x.stream ());
nInSt.forEach (System.out :: print);

What is the result?

  1. 1John2null
  2. 12
  3. A NullPointerException is thrown at run time.
  4. A compilation error occurs.

Answer(s): D



Given the code fragment:

Path file = Paths.get (“courses.txt”);
// line n1

Assume the courses.txt is accessible.
Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file?

  1. List<String> fc = Files.list(file); fc.stream().forEach (s - > System.out.println(s));
  2. Stream<String> fc = Files.readAllLines (file); fc.forEach (s - > System.out.println(s));
  3. List<String> fc = readAllLines(file); fc.stream().forEach (s - > System.out.println(s));
  4. Stream<String> fc = Files.lines (file); fc.forEach (s - > System.out.println(s));

Answer(s): D



Given the code fragment:
public void recDelete (String dirName) throws IOException {
File [ ] listOfFiles = new File (dirName) .listFiles();
if (listOfFiles ! = null && listOfFiles.length >0) {
for (File aFile : listOfFiles) {
if (aFile.isDirectory ()) {
recDelete (aFile.getAbsolutePath ());
} else {
if (aFile.getName ().endsWith (“.class”))
aFile.delete ();
}
}
}
}

Assume that Projects contains subdirectories that contain .class files and is passed as an argument to the recDelete () method when it is invoked. What is the result?

  1. The method deletes all the .class files in the Projects directory and its subdirectories.
  2. The method deletes the .class files of the Projects directory only.
  3. The method executes and does not make any changes to the Projects directory.
  4. The method throws an IOException.

Answer(s): A



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?

  1. Comment the lines 28, 29 and 30.
  2. Replace line 26 with:
    } catch (Exception | ArithmeticException | NumberFormatException e) {
  3. Replace line 26 with:
    } catch (ArithmeticException | NumberFormatException e) {
  4. Replace line 27 with:
    throw e;

Answer(s): C



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 ()
.collect(Collectors.groupingBy (Country ::getRegion,
Collectors.mapping(Country::getName, Collectors.toList()))));
System.out.println(regionNames);

  1. {EUROPE = [Italy, Germany], ASIA = [Japan]}
  2. {ASIA = [Japan], EUROPE = [Italy, Germany]}
  3. {EUROPE = [Germany, Italy], ASIA = [Japan]}
  4. {EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}

Answer(s): B



Viewing Page 3 of 35



Share your comments for Oracle 1Z0-809 exam with other users:

TestPD1 8/10/2023 12:19:00 PM

question 17 : responses arent b and c ?
EUROPEAN UNION


Nhlanhla 12/13/2023 5:26:00 AM

just passed the exam on my first try using these dumps.
Anonymous


Rizwan 1/6/2024 2:18:00 AM

very helpful
INDIA


Yady 5/24/2023 10:40:00 PM

these questions look good.
SINGAPORE


Kettie 10/12/2023 1:18:00 AM

this is very helpful content
Anonymous


SB 7/21/2023 3:18:00 AM

please provide the dumps
UNITED STATES


David 8/2/2023 8:20:00 AM

it is amazing
Anonymous


User 8/3/2023 3:32:00 AM

quesion 178 about "a banking system that predicts whether a loan will be repaid is an example of the" the answer is classification. not regresion, you should fix it.
EUROPEAN UNION


quen 7/26/2023 10:39:00 AM

please upload apache spark dumps
Anonymous


Erineo 11/2/2023 5:34:00 PM

q14 is b&c to reduce you will switch off mail for every single alert and you will switch on daily digest to get a mail once per day, you might even skip the empty digest mail but i see this as a part of the daily digest adjustment
Anonymous


Paul 10/21/2023 8:25:00 AM

i think it is good question
Anonymous


Unknown 8/15/2023 5:09:00 AM

good for students who wish to give certification.
INDIA


Ch 11/20/2023 10:56:00 PM

is there a google drive link to the images? the links in questions are not working.
AUSTRALIA


Joey 5/16/2023 5:25:00 AM

very promising, looks great, so much wow!
Anonymous


alaska 10/24/2023 5:48:00 AM

i scored 87% on the az-204 exam. thanks! i always trust
GERMANY


nnn 7/9/2023 11:09:00 PM

good need more
Anonymous


User-sfdc 12/29/2023 7:21:00 AM

sample questions seems good
Anonymous


Tamer dam 8/4/2023 10:21:00 AM

huawei is ok
UNITED STATES


YK 12/11/2023 1:10:00 AM

good one nice
JAPAN


de 8/28/2023 2:38:00 AM

please continue
GERMANY


DMZ 6/25/2023 11:56:00 PM

this exam dumps just did the job. i donot want to ruffle your feathers but your exam dumps and mock test engine is amazing.
UNITED KINGDOM


Jose 8/30/2023 6:14:00 AM

nice questions
PORTUGAL


Tar01 7/24/2023 7:07:00 PM

the explanation are really helpful
Anonymous


DaveG 12/15/2023 4:50:00 PM

just passed my exam yesterday on my first attempt. these dumps were extremely helpful in passing first time. the questions were very, very similar to these questions!
Anonymous


A.K. 6/30/2023 6:34:00 AM

cosmos db is paas not saas
Anonymous


S Roychowdhury 6/26/2023 5:27:00 PM

what is the percentage of common questions in gcp exam compared to 197 dump questions? are they 100% matching with real gcp exam?
Anonymous


Bella 7/22/2023 2:05:00 AM

not able to see questions
Anonymous


Scott 9/8/2023 7:19:00 AM

by far one of the best sites for free questions. i have pass 2 exams with the help of this website.
CANADA


donald 8/19/2023 11:05:00 AM

excellent question bank.
Anonymous


Ashwini 8/22/2023 5:13:00 AM

it really helped
Anonymous


sk 5/13/2023 2:07:00 AM

excelent material
INDIA


Christopher 9/5/2022 10:54:00 PM

the new versoin of this exam which i downloaded has all the latest questions from the exam. i only saw 3 new questions in the exam which was not in this dump.
CANADA


Sam 9/7/2023 6:51:00 AM

question 8 - can cloudtrail be used for storing jobs? based on aws - aws cloudtrail is used for governance, compliance and investigating api usage across all of our aws accounts. every action that is taken by a user or script is an api call so this is logged to [aws] cloudtrail. something seems incorrect here.
UNITED STATES


Tanvi Rajput 8/14/2023 10:55:00 AM

question 13 tda - c01 answer : quick table calculation -> percentage of total , compute using table down
UNITED KINGDOM