1Z0-805 Exam Details

  • Exam Code
    :1Z0-805
  • Exam Name
    :Upgrade to Java SE 7 Programmer
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :90 Q&As
  • Last Updated
    :Dec 09, 2021

Oracle 1Z0-805 Online Questions & Answers

  • Question 1:

    Given the code fragment:

    SimpleDateFormat sdf = new SimpleDateFormat("zzzz", Locale.US);

    System.out.println ("Result: " + sdf.format(today) ) ;

    What type of result is printed?

    A. Time zone abbreviation
    B. Full-text time zone name
    C. Era
    D. Julian date
    E. Time of the Epoch (in milliseconds)

  • Question 2:

    Given this code fragment:

    try {

    String query = "SELECT * FROM Item";

    Statement stmt = conn.createStatement();

    ResultSet rs = stmt.executeQuery(query);

    ResultSetMetaData rsmd = rs.getMetaData();

    int rowCount = rsmd.getRowCount();

    System.out.println ("Processing: " + rowCount + " rows.");

    while (rs.next()) {

    // Process each row

    }

    } catch (SQLException se)

    { System.out.println("Error");

    }

    Assume that the SQL query returns records. What is the result?

    A. Compilation fails.
    B. The program prints Error
    C. An exception is thrown at runtime
    D. The statement at line 16 execute

  • Question 3:

    Given a resource bundle MessageBundle, what is the name of the default bundle file?

    A. MessageBundle.profile
    B. MessageBundle.xml
    C. MessageBundle.java
    D. MessageBundle.properties

  • Question 4:

    The current working directory is named finance.

    Which two code fragments allow you to write the salary.dat file if it does not exist under "finance\payroll"?

    A. public static void setFileContent (String[] s) throws IOException { path p=paths.get("payroll\\salary.dat"); File file=p.toAbsolutePath().toFile(); try (BufferWriter br = new BufferWriter (new FileWriter(File))) { br.write ("experience new features of java"); } }
    B. public static void setFileContent (String[] s) throws IOException { path p=paths.get ("payroll\\salary.dat"); File file=p.toAbsolutePath(LinkOption.NOFOLLOW_LINKS).toFile(); try (BufferWriter br = new BufferWriter (new FileWriter(File))) { br.write ("experience new features of java"); } }
    C. public static void setFileContent (String[] s) throws IOException { File file= new file ("payroll\\salary.dat").getCanonicalFile(); try (BufferWriter br = new BufferWriter (new FileWriter(File))) { br.write ("experience new features of java"); } }
    D. public static void setFileContent (String[] s) throws IOException { File file= new File ("payroll\\salary.dat").getCanonicalFile(); try (BufferWriter br = new BufferWriter (new FileWriter(File))) { br.write ("experience new features of java"); } }
    E. public static void setFileContent (String[] s) throws IOException { File file=new File ("payroll\\salary.dat").getAbsolutePath(); try (BufferWriter br = new BufferWriter (new FileWriter(File))) { br.write ("experience new features of java"); } }

  • Question 5:

    Given:

    public class DataCache {

    private static final DataCache instance = new DataCache ();

    public static DataCache getInstance () {

    return instance;

    }

    Which design pattern best describes the class?

    A. Singleton
    B. DAO
    C. Abstract Factory
    D. Composition

  • Question 6:

    Given the code fragment:

    11.

    public static getFileSize () throws IOException {

    12.

    path file = paths.get ("ex.txt");

    13.

    //insert code here

    14.

    System.out.println ("size: " + attr.size());

    15.

    }

    public static getFileSize () throws IOException

    { Path file = Paths.get ("ex.txt");

    //insert code here Line **

    System.out.println ("size: " + attr.size());

    }

    Which two fragments, when inserted independently at line **, enable printing of the file size?

    A. BasicFileAttributes attr = Files.readAttributes (file, BasicFileAttributes.class);
    B. PosixFileAttributes attr = Files.readAttributes (file, posixFileAttributes.class);
    C. DosFileAttributes attr = Files.readAttributes (file, dosAttributes.class);
    D. FileStore attr = Files.getFileStore (file);
    E. AclFileAttributeview attr = Files.getFileAttributeView(File, AclFileAttributeview.class);

  • Question 7:

    Given:

    import java.io.*;

    public class SampleClass {

    public static void main(String[] args) throws IOException {

    try {

    String dirName = args[0];

    File dir = new File(dirName);

    File.createTempFile("temp", "log", dir);

    } catch (NullPointerException | IOException e) {

    e = new IOException("Error while creating temp file");

    throw e;

    }

    }

    }

    What is the result?

    A. Compilation fails.
    B. An IOException with the default message is thrown at runtime.
    C. An IOException with the message Error while creating temp file is thrown at runtime.
    D. A temporary file is created in the specified directory.

  • Question 8:

    Given the code fragment:

    public class App {

    public static void main (String [] args) {

    path path = paths.get("C\\educations\\institute\\student\\report.txt");

    system.out.printIn("getName(0): %s", path.getName(0));

    system.out.prinIn("subpath(0, 2): %s" path.subpath(0, 2));

    }

    }

    What is the result?

    A. getName (0): C:\ subpath(0, 2): C:\education\report.txt
    B. getName (0): C:\ subpath(0, 2): education\institute
    C. getName(0): education subpath(0, 2: education\institute\student
    D. getName(0): education subpath(0, 2): education\institute
    E. getName(0): report.txt subpath (0, 2): institute\student

  • Question 9:

    The two methods of course rescue that aggregate the features located in multiple classes are .

    A. Inheritance
    B. Copy and Paste
    C. Composition
    D. Refactoring
    E. Virtual Method Invocation

  • Question 10:

    Which two methods are defined in the FileStore class print disk space information?

    A. getTotalSpace ()
    B. getFreeSpace ()
    C. getUsableSpace ()
    D. getTotalCapacity ()
    E. getUsed ()

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-805 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.