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

Viewing Page 7 of 35

Given the code fragment:
Stream<Path> files = Files.walk(Paths.get(System.getProperty(“user.home”)));
files.forEach (fName -> { //line n1
try {
Path aPath = fName.toAbsolutePath(); //line n2
System.out.println(fName + “:”
+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime
());
} catch (IOException ex) {
ex.printStackTrace();

});

What is the result?

  1. All files and directories under the home directory are listed along with their attributes.
  2. A compilation error occurs at line n1.
  3. The files in the home directory are listed along with their attributes.
  4. A compilation error occurs at line n2.

Answer(s): A



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?

  1. 10123 Ford 10124 BMW
  2. 10124 BMW 10123 Ford
  3. A compilation error occurs.
  4. A ClassCastException is thrown at run time.

Answer(s): D



Given that course.txt is accessible and contains:

Course : : Java

and given the code fragment:

public static void main (String[ ] args) {
int i;
char c;
try (FileInputStream fis = new FileInputStream (“course.txt”);
InputStreamReader isr = new InputStreamReader(fis);) {
while (isr.ready()) { //line n1
isr.skip(2);
i = isr.read ();
c = (char) i;
System.out.print(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}

What is the result?

  1. ur :: va
  2. ueJa
  3. The program prints nothing.
  4. A compilation error occurs at line n1.

Answer(s): B



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?

  1. Java 100
  2. java.lang.string@<hashcode>java.lang.Integer@<hashcode>
  3. A compilation error occurs. To rectify it, replace line n1 with:
    Test<Integer> type1 = new Test<>();
  4. A compilation error occurs. To rectify it, replace line n2 with:
    type1.set (Integer(100));

Answer(s): A



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?

  1. Make the Vehicle class public.
  2. Make the name variable public.
  3. Make the setName method public.
  4. Make the name variable private.
  5. Make the setName method private.
  6. Make the getName method private.

Answer(s): D



Viewing Page 7 of 35



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

exampei 8/7/2023 8:05:00 AM

please upload c_tadm_23 exam
TURKEY


Anonymous 9/12/2023 12:50:00 PM

can we get tdvan4 vantage data engineering pdf?
UNITED STATES


Aish 10/11/2023 5:51:00 AM

want to clear the exam.
INDIA


Smaranika 6/22/2023 8:42:00 AM

could you please upload the dumps of sap c_sac_2302
INDIA


Blessious Phiri 8/15/2023 1:56:00 PM

asm management configuration is about storage
Anonymous


Lewis 7/6/2023 8:49:00 PM

kool thumb up
UNITED STATES


Moreece 5/15/2023 8:44:00 AM

just passed the az-500 exam this last friday. most of the questions in this exam dumps are in the exam. i bought the full version and noticed some of the questions which were answered wrong in the free version are all corrected in the full version. this site is good but i wish the had it in an interactive version like a test engine simulator.
Anonymous


Terry 5/24/2023 4:41:00 PM

i can practice for exam
Anonymous


Emerys 7/29/2023 6:55:00 AM

please i need this exam.
Anonymous


Goni Mala 9/2/2023 12:27:00 PM

i need the dump
Anonymous


Lenny 9/29/2023 11:30:00 AM

i want it bad, even if cs6 maybe retired, i want to learn cs6
HONG KONG


MilfSlayer 12/28/2023 8:32:00 PM

i hate comptia with all my heart with their "choose the best" answer format as an argument could be made on every question. they say "the "comptia way", lmao no this right here boys is the comptia way 100%. take it from someone whos failed this exam twice but can configure an entire complex network that these are the questions that are on the test 100% no questions asked. the pbqs are dead on! nice work
Anonymous


Swati Raj 11/14/2023 6:28:00 AM

very good materials
UNITED STATES


Ko Htet 10/17/2023 1:28:00 AM

thanks for your support.
Anonymous


Philippe 1/22/2023 10:24:00 AM

iam impressed with the quality of these dumps. they questions and answers were easy to understand and the xengine app was very helpful to use.
CANADA


Sam 8/31/2023 10:32:00 AM

not bad but you question database from isaca
MALAYSIA


Brijesh kr 6/29/2023 4:07:00 AM

awesome contents
INDIA


JM 12/19/2023 1:22:00 PM

answer to 134 is casb. while data loss prevention is the goal, in order to implement dlp in cloud applications you need to deploy a casb.
UNITED STATES


Neo 7/26/2023 9:36:00 AM

are these brain dumps sufficient enough to go write exam after practicing them? or does one need more material this wont be enough?
SOUTH AFRICA


Bilal 8/22/2023 6:33:00 AM

i did attend the required cources and i need to be sure that i am ready to take the exam, i would ask you please to share the questions, to be sure that i am fit to proceed with taking the exam.
Anonymous


John 11/12/2023 8:48:00 PM

why only give explanations on some, and not all questions and their respective answers?
UNITED STATES


Biswa 11/20/2023 8:50:00 AM

refresh db knowledge
Anonymous


Shalini Sharma 10/17/2023 8:29:00 AM

interested for sap certification
JAPAN


ethan 9/24/2023 12:38:00 PM

could you please upload practice questions for scr exam ?
HONG KONG


vijay joshi 8/19/2023 3:15:00 AM

please upload free oracle cloud infrastructure 2023 foundations associate exam braindumps
Anonymous


Ayodele Talabi 8/25/2023 9:25:00 PM

sweating! they are tricky
CANADA


Romero 3/23/2022 4:20:00 PM

i never use these dumps sites but i had to do it for this exam as it is impossible to pass without using these question dumps.
UNITED STATES


John Kennedy 9/20/2023 3:33:00 AM

good practice and well sites.
Anonymous


Nenad 7/12/2022 11:05:00 PM

passed my first exam last week and pass the second exam this morning. thank you sir for all the help and these brian dumps.
INDIA


Lucky 10/31/2023 2:01:00 PM

does anyone who attended exam csa 8.8, can confirm these questions are really coming ? or these are just for practicing?
HONG KONG


Prateek 9/18/2023 11:13:00 AM

kindly share the dumps
UNITED STATES


Irfan 11/25/2023 1:26:00 AM

very nice content
Anonymous


php 6/16/2023 12:49:00 AM

passed today
Anonymous


Durga 6/23/2023 1:22:00 AM

hi can you please upload questions
Anonymous