Oracle

1z0-819 practice test

Practice with 15 free Testara sample questions, or choose paid access to the full 136-question bank.

Provider
Oracle
Question bank
136
Free sample
15 questions
Publisher
Testara

About this practice material

This page covers Testara's practice question bank for 1z0-819, a certification listed under Oracle. Questions use original, exam-style scenarios and are not questions from the official certification exam.

Testara is an independent practice platform and is not affiliated with, endorsed by, or authorized by Oracle. The certification credential is issued by Oracle, not Testara. Certification and provider names belong to their respective owners.

Start practicing

The guest demo does not save an attempt. Sign in before buying access.

Try 15 questions free

Available without signing in

Free sample questions

These 15 questions and their explanations are server-rendered so you can inspect the material before opening the interactive demo.

  1. Question 1 · 1

    Given TripleThis.java: Compiling TripleThis.java gives this compiler warning: Note: TripleThis.java uses unchecked or unsafe operations. Which two replacements remove this compiler warning and prints 12? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • Replace line 12 with public static void printValue(Function f, int num) {
    • Replace line 12 with public static void printValue(Function f, T num) {
    • Replace line 9 with Function tripler = x —> { return (Integer) x * 3; }
    • Replace line 12 with public static void printValue(Function f, Integer num) {
    • Replace line 9 with Function tripler = x -> { return x * 3; }
    • Replace line 9 with Function tripler = x -> [ return x * 3; ]
  2. Question 2 · 1

    Given the code fragment: What change on line 1 will make this code compile?

    Choose one answer.

    Question illustration 1
    • Add catch(M | L e)
    • Add catch(L e)
    • Add catch(N | L | M e)
    • Add catch(L | N e)
    • Add catch(L | M | N e)
  3. Question 3 · 1

    Given the code fragment: Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • Main.prefix + Main.name
    • prefix + getName
    • Main.prefix + Main.getName()
    • new Main().prefix + new Main().name
    • prefix + name
    • prefix + Main.name
  4. Question 4 · 1

    Given: Automobile.java - Car.java - What must you do so that the code prints 4?

    Choose one answer.

    Question illustration 1
    Question illustration 2
    • Remove the parameter from wheels method in line 3.
    • Remove abstract keyword in line 1.
    • Replace the code in line 2 with Car ob = new Car();.
    • Add @Override annotation at line 2.
  5. Question 5 · 1

    Which module is required for any application using Swing or AWT?

    Choose one answer.

    • java.desktop
    • java.prefs
    • java.se
    • java.logging
    • java.rmi
  6. Question 6 · 1

    Which set of commands is necessary to create and run a custom runtime image from Java source files?

    Choose one answer.

    • java,jdeps
    • javac,jlink
    • javac,jar
    • jar,jlink
  7. Question 7 · 1

    Given the code fragment: Which would cause s to be AQCD?

    Choose one answer.

    Question illustration 1
    • s.replace(s.indexOf("B"), s.indexOf("B"), "Q");
    • s.replace(s.indexOf("A"), s.indexOf("B"), "Q");
    • s.replace(s.indexOf("B"), s.indexOf("C"), "Q");
    • s.replace(s.indexOf("A"), s.indexOf("C"), "Q");
  8. Question 8 · 1

    Given: and What is the result?

    Choose one answer.

    Question illustration 1
    Question illustration 2
    • test:null
    • test:1
    • A ClassCastException is thrown at runtime.
    • null:null
    • The compilation fails.
  9. Question 9 · 1

    Given: Given the directory structure: Given the commands to execute at the Test directory prompt: Which statement is true?

    Choose one answer.

    Question illustration 1
    Question illustration 2
    Question illustration 3
    • Create an empty module-info.java file in the Test directory and on execution of the given commands, the program prints:
    • On execution of the given commands, the program prints:
    • Execute java --module-path pac pac.Hello instead of java -cp pac pac.Hello and on execution the program prints:
    • On execution of the given commands, the program prints:
  10. Question 10 · 1

    Given: and What is the result?

    Choose one answer.

    Question illustration 1
    Question illustration 2
    • 214
    • 2341
    • 234
    • 2134
  11. Question 11 · 1

    Given: What is the output?

    Choose one answer.

    Question illustration 1
    • A NullPointerException is thrown at run time.
    • null
    • Duke
    • A NoSuchElementException is thrown at run time.
  12. Question 12 · 1

    Given: Taking into account that the order of the elements is unpredictable, what is the output?

    Choose one answer.

    Question illustration 1
    • {am=2, first=1, mismatch=1, second=2}
    • {mismatch=2, am=2, first=1, second=1}
    • {l=mismatch, 2=am}
    • {mismatch=1, am=2, first=1, second=1}
  13. Question 13 · 1

    Given these declarations: and these two code fragments: Fragment 1: Fragment 2: Which code fragment is preferred and why?

    Choose one answer.

    Question illustration 1
    Question illustration 2
    Question illustration 3
    • Fragment 1 because it is shorter.
    • Fragment 2 because it prevents SQL injection.
    • Fragment 2 because it explicitly specifies the SQL types of the column values.
    • Fragment 1 because it is more performant.
  14. Question 14 · 1

    Given: How many LocalDate objects are created in this example?

    Choose one answer.

    Question illustration 1
    • 2
    • 3
    • 4
    • 5
  15. Question 15 · 1

    Given: You want to calculate the average of the Player’s score. Which statement inserted on line 1 will accomplish this?

    Choose one answer.

    Question illustration 1
    • players.stream().average().orElse(0.0);
    • players.stream().mapToInt(a -> a.score).average().orElse(0.0);
    • players.stream().mapToDouble(a -> a.score).average();
    • players.stream().map(a -> a.score).average();

Each purchase applies to this certification. Prices are one-time payments, not monthly subscriptions.

Starter

$29 USD one time

Full access to one certification's question bank in standard practice mode for 60 days.

  • Full question bank for one certification
  • 60 days of access
  • Standard practice mode
  • Question notes and community discussions
  • Attempt scores and answer review

Professional

$49 USD one time

Full access to one certification's question bank, custom test controls and advanced analytics for 60 days.

  • Custom test builder
  • Timers and question selection
  • Randomized question and answer order
  • Advanced performance and weak-question analytics
  • Priority customer support
Try 15 questions free