Oracle 1Z0-809 Exam (page: 5)
Oracle Java SE 8 Programmer II
Updated on: 28-Nov-2025

Viewing Page 5 of 35

Given the code fragments:
class MyThread implements Runnable {
private static AtomicInteger count = new AtomicInteger (0);
public void run () {
int x = count.incrementAndGet();
System.out.print (x+” “);
}
}

and

Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());

Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
ta[x].start();
}

Which statement is true?

  1. The program prints 1 2 3 and the order is unpredictable.
  2. The program prints 1 2 3.
  3. The program prints 1 1 1.
  4. A compilation error occurs.

Answer(s): A



Given the code fragment:
public static void main (String [ ] args) throws IOException {
BufferedReader br = new BufferedReader (new InputStremReader (System.in));
System.out.print (“Enter GDP: “);
//line 1
}

Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?

  1. int GDP = Integer.parseInt (br.readline());
  2. int GDP = br.read();
  3. int GDP = br.nextInt();
  4. int GDP = Integer.parseInt (br.next());

Answer(s): A



Given the code fragment:
Path source = Paths.get (“/data/december/log.txt”);
Path destination = Paths.get(“/data”);
Files.copy (source, destination);

and assuming that the file /data/december/log.txt is accessible and contains:
10-Dec-2014 – Executed successfully

What is the result?

  1. A file with the name log.txt is created in the /data directory and the content of the /data/december/ log.txt file is copied to it.
  2. The program executes successfully and does NOT change the file system.
  3. A FileNotFoundException is thrown at run time.
  4. A FileAlreadyExistsException is thrown at run time.

Answer(s): D



Given:
class Student {
String course, name, city;
public Student (String name, String course, String city) {
this.course = course; this.name = name; this.city = city;
}
public String toString() {
return course + “:” + name + “:” + city;
}

and the code fragment:

List<Student> stds = Arrays.asList(
new Student (“Jessy”, “Java ME”, “Chicago”),
new Student (“Helen”, “Java EE”, “Houston”),
new Student (“Mark”, “Java ME”, “Chicago”));
stds.stream()
.collect(Collectors.groupingBy(Student::getCourse))
.forEach(src, res) -> System.out.println(scr));


What is the result?

  1. [Java EE: Helen:Houston]
    [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]
  2. Java EE Java ME
  3. [Java ME: Jessy:Chicago, Java ME: Mark:Chicago] [Java EE: Helen:Houston]
  4. A compilation error occurs.

Answer(s): B



Given the code fragments:
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.equals (“Java”);
}
}

and

List<String> strs = Arrays.asList(“Java”, “Java EE”, “Java ME”);
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.contains (“Java”);
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2 //line n2
.count();
System.out.println(c);

What is the result?

  1. 2
  2. 3
  3. A compilation error occurs at line n1.
  4. A compilation error occurs at line n2.

Answer(s): B



Viewing Page 5 of 35



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

BV 6/8/2023 4:35:00 AM

good questions
NETHERLANDS


krishna 12/19/2023 2:05:00 AM

valied exam dumps. they were very helpful and i got a pretty good score. i am very grateful for this service and exam questions
Anonymous


Pie 9/3/2023 4:56:00 AM

will it help?
INDIA


Lucio 10/6/2023 1:45:00 PM

very useful to verify knowledge before exam
POLAND


Ajay 5/17/2023 4:54:00 AM

good stuffs
Anonymous


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