Summer Special - 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4sdisc65

1z0-809 PDF

$38.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

1z0-809 PDF + Testing Engine

$61.6

$175.99

3 Months Free Update

  • Exam Name: Java SE 8 Programmer II
  • Last Update: Sep 12, 2025
  • Questions and Answers: 208
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

1z0-809 Engine

$46.2

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

1z0-809 Practice Exam Questions with Answers Java SE 8 Programmer II Certification

Question # 6

Given the code fragment:

1z0-809 question answer

What is the result?

A.

DavidDavid[Susan, Allen]

B.

SusanSusan[Susan, Allen]

C.

SusanAllen[David]

D.

DavidAllen[Susan]

E.

SusanAllen[Susan, David]

Full Access
Question # 7

Given the code fragment:

List codes = Arrays.asList (10, 20);

UnaryOperator uo = s -> s +10.0;

codes.replaceAll(uo);

codes.forEach(c -> System.out.println(c));

What is the result?

A.

20.030.0

B.

1020

C.

A compilation error occurs.

D.

A NumberFormatException is thrown at run time.

Full Access
Question # 8

Given the Greetings.properties file, containing:

1z0-809 question answer

and given:

1z0-809 question answer

What is the result?

A.

Compilation fails.

B.

GOODBY_MSG

C.

Hello, everyone!

D.

Goodbye everyone!

E.

HELLO_MSG

Full Access
Question # 9

Given the code fragments:

interface CourseFilter extends Predicate {

public default boolean test (String str) {

return str.contains (“Java”);

}

}

and

List strs = Arrays.asList(“Java”, “Java EE”, “Embedded Java”);

Predicate cf1 = s - > s.length() > 3;

Predicate cf2 = new CourseFilter() { //line n1

public boolean test (String s) {

return s.startsWith (“Java”);

}

};

long c = strs.stream()

.filter(cf1)

.filter(cf2//line n2

.count();

System.out.println(c);

What is the result?

A.

2

B.

3

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Full Access
Question # 10

Given:

class RateOfInterest {

public static void main (String[] args) {

int rateOfInterest = 0;

String accountType = “LOAN”;

switch (accountType) {

case “RD”;

rateOfInterest = 5;

break;

case “FD”;

rateOfInterest = 10;

break;

default:

assert false: “No interest for this account”; //line n1

}

System.out.println (“Rate of interest:” + rateOfInterest);

}

}

and the command:

java –ea RateOfInterest

What is the result?

A.

Rate of interest: 0

B.

An AssertionError is thrown.

C.

No interest for this account

D.

A compilation error occurs at line n1.

Full Access
Question # 11

Given:

1z0-809 question answer

Which is refactored code with functional interfaces?

A.

1z0-809 question answer

B.

1z0-809 question answer

C.

1z0-809 question answer

D.

1z0-809 question answer

Full Access
Question # 12

Given:

1z0-809 question answer

What is the result?

A.

The program prints nothing.

B.

A compile-time error occurs.

C.

Exception is thrown.

D.

MyException is thrown.

Full Access
Question # 13

For which three objects must a vendor provide implementations in its JDBC driver? (Choose three.)

A.

Time

B.

Date

C.

Statement

D.

ResultSet

E.

Connection

F.

SQLException

G.

DriverManager

Full Access
Question # 14

Given:

1z0-809 question answer

and the code fragment:

1z0-809 question answer

What is the result?

A.

0

B.

A compilation error occurs at line n1.

C.

An Exception is thrown at run time.

D.

2

Full Access
Question # 15

Given:

class FuelNotAvailException extends Exception { }

class Vehicle {

void ride() throws FuelNotAvailException {//line n1

System.out.println(“Happy Journey!”);

}

}

class SolarVehicle extends Vehicle {

public void ride () throws Exception {//line n2

super ride ();

}

}

and the code fragment:

public static void main (String[] args) throws FuelNotAvailException, Exception {

Vehicle v = new SolarVehicle ();

v.ride();

}

Which modification enables the code fragment to print Happy Journey!?

A.

Replace line n1 with public void ride() throws FuelNotAvailException {

B.

Replace line n1 with protected void ride() throws Exception {

C.

Replace line n2 with void ride() throws Exception {

D.

Replace line n2 with private void ride() throws FuelNotAvailException {

Full Access
Question # 16

Given that these files exist and are accessible:

1z0-809 question answer

and given the code fragment:

1z0-809 question answer

Which code fragment can be inserted at line n1 to enable the code to print only /company/emp?

A.

Stream stream = Files.list (Paths.get (“/company”));

B.

Stream stream = Files.find(Paths.get (“/company”), 1,(p,b) –> b.isDirectory (), FileVisitOption.FOLLOW_LINKS);

C.

Stream stream = Files.walk (Paths.get (“/company”));

D.

Stream stream = Files.list (Paths.get (“/company/emp”));

Full Access
Question # 17

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?

A.

Make the Vehicle class public.

B.

Make the name variable public.

C.

Make the setName method public.

D.

Make the name variable private.

E.

Make the setName method private.

F.

Make the getName method private.

Full Access
Question # 18

Given the code fragment:

1z0-809 question answer

What is the result?

A.

A compilation error occurs at line n2.

B.

3

C.

2

D.

A compilation error occurs at line n1.

Full Access
Question # 19

Given that /green.txt and /colors/yellow.txt are accessible, and the code fragment:

Path source = Paths.get(“/green.txt);

Path target = Paths.get(“/colors/yellow.txt);

Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);

Files.delete(source);

Which statement is true?

A.

The green.txt file content is replaced by the yellow.txt file content and the yellow.txt file is deleted.

B.

The yellow.txt file content is replaced by the green.txt file content and an exception is thrown.

C.

The file green.txt is moved to the /colors directory.

D.

A FileAlreadyExistsException is thrown at runtime.

Full Access
Question # 20

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?

A.

int GDP = Integer.parseInt (br.readline());

B.

int GDP = br.read();

C.

int GDP = br.nextInt();

D.

int GDP = Integer.parseInt (br.next());

Full Access
Question # 21

Given the code fragment:

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

BufferedReader brCopy = null;

try (BufferedReader br = new BufferedReader (new FileReader(“employee.txt”))) { //

line n1

br.lines().forEach(c -> System.out.println(c));

brCopy = br;//line n2

}

brCopy.ready(); //line n3;

}

Assume that the ready method of the BufferedReader, when called on a closed BufferedReader, throws an exception, and employee.txt is accessible and contains valid text.

What is the result?

A.

A compilation error occurs at line n3.

B.

A compilation error occurs at line n1.

C.

A compilation error occurs at line n2.

D.

The code prints the content of the employee.txt file and throws an exception at line n3.

Full Access
Question # 22

Given the code fragment:

List values = Arrays.asList (1, 2, 3);

values.stream ()

.map(n -> n*2)//line n1

.peek(System.out::print)//line n2

.count();

What is the result?

A.

246

B.

The code produces no output.

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Full Access
Question # 23

Which two methods from the java.util.stream.Stream interface perform a reduction operation? (Choose two.)

A.

count ()

B.

collect ()

C.

distinct ()

D.

peek ()

E.

filter ()

Full Access
Question # 24

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 ()) {

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?

A.

The method deletes all the .class files in the Projects directory and its subdirectories.

B.

The method deletes the .class files of the Projects directory only.

C.

The method executes and does not make any changes to the Projects directory.

D.

The method throws an IOException.

Full Access
Question # 25

Given:

class Book {

int id;

String name;

public Book (int id, String name) {

this.id = id;

this.name = name;

}

public boolean equals (Object obj) { //line n1

boolean output = false;

Book b = (Book) obj;

if (this.id = = b.id) {

output = true;

}

return output;

}

}

and the code fragment:

Book b1 = new Book (101, “Java Programing”);

Book b2 = new Book (102, “Java Programing”);

System.out.println (b1.equals(b2)); //line n2

Which statement is true?

A.

The program prints true.

B.

The program prints false.

C.

A compilation error occurs. To ensure successful compilation, replace line n1 with:boolean equals (Book obj) {

D.

A compilation error occurs. To ensure successful compilation, replace line n2 with:System.out.println (b1.equals((Object) b2));

Full Access
Question # 26

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?

A.

Comment the lines 28, 29 and 30.

B.

Replace line 26 with:} catch (Exception | ArithmeticException | NumberFormatException e) {

C.

Replace line 26 with:} catch (ArithmeticException | NumberFormatException e) {

D.

Replace line 27 with:throw e;

Full Access
Question # 27

Given:

1z0-809 question answer

and

1z0-809 question answer

Which interface from the java.util.function package should you use to refactor the class Txt?

A.

Consumer

B.

Predicate

C.

Supplier

D.

Function

Full Access
Question # 28

Which class definition compiles?

A.
B.
C.
D.
Full Access
Question # 29

Given:

1. abstract class Shape {

2. Shape ( ) { System.out.println (“Shape”); }

3. protected void area ( ) { System.out.println (“Shape”); }

4. }

5.

6. class Square extends Shape {

7. int side;

8. Square int side {

9./* insert code here */

10. this.side = side;

11. }

12. public void area ( ) { System.out.println (“Square”); }

13. }

14. class Rectangle extends Square {

15. int len, br;

16. Rectangle (int x, int y) {

17. /* insert code here */

18. len = x, br = y;

19. }

20. void area ( ) { System.out.println (“Rectangle”); }

21. }

Which two modifications enable the code to compile? (Choose two.)

A.

At line 1, remove abstract

B.

At line 9, insert super ( );

C.

At line 12, remove public

D.

At line 17, insert super (x);

E.

At line 17, insert super (); super.side = x;

F.

At line 20, use public void area ( ) {

Full Access
Question # 30

Given the code fragment:

1z0-809 question answer

Which modification enables the code to print Price 5 New Price 4?

A.

Replace line n2 with .map (n -> System.out.println (“New Price” + n –1)) and remove line n3

B.

Replace line n2 with .mapToInt (n -> n – 1);

C.

Replace line n1 with .forEach (e -> System.out.print (“Price” + e))

D.

Replace line n3 with .forEach (n -> System.out.println (“New Price” + n));

Full Access
Question # 31

Given:

1z0-809 question answer

What is the result?

A.

–catch--finally--dostuff-

B.

–catch-

C.

–finally--catch-

D.

–finally-dostuff--catch-

Full Access
Question # 32

Given:

interface Rideable {Car getCar (String name); }

class Car {

private String name;

public Car (String name) {

this.name = name;

}

}

Which code fragment creates an instance of Car?

A.

Car auto = Car (“MyCar”): : new;

B.

Car auto = Car : : new;Car vehicle = auto : : getCar(“MyCar”);

C.

Rideable rider = Car : : new;Car vehicle = rider.getCar(“MyCar”);

D.

Car vehicle = Rideable : : new : : getCar(“MyCar”);

Full Access
Question # 33

Which statement is true about java.util.stream.Stream?

A.

A stream cannot be consumed more than once.

B.

The execution mode of streams can be changed during processing.

C.

Streams are intended to modify the source data.

D.

A parallel stream is always faster than an equivalent sequential stream.

Full Access
Question # 34

Given the code fragments:

1z0-809 question answer

and

1z0-809 question answer

What is the result?

A.

null

B.

A compilation error occurs.

C.

DogCatMouse

D.

[Dog, Cat, Mouse]

Full Access
Question # 35

Given the code fragment:

List listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”);

System.out.println (

// line n1

);

Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?

A.

listVal.stream().filter(x -> x.length()>3).count()

B.

listVal.stream().map(x -> x.length()>3).count()

C.

listVal.stream().peek(x -> x.length()>3).count().get()

D.

listVal.stream().filter(x -> x.length()>3).mapToInt(x -> x).count()

Full Access
Question # 36

Given:

class Bird {

public void fly () { System.out.print(“Can fly”); }

}

class Penguin extends Bird {

public void fly () { System.out.print(“Cannot fly”); }

}

and the code fragment:

class Birdie {

public static void main (String [ ] args) {

fly( ( ) -> new Bird ( ));

fly (Penguin : : new);

}

/* line n1 */

}

Which code fragment, when inserted at line n1, enables the Birdie class to compile?

A.

static void fly (Consumer bird) {bird :: fly ();}

B.

static void fly (Consumer bird) {bird.accept( ) fly ();}

C.

static void fly (Supplier bird) {bird.get( ) fly ();}

D.

static void fly (Supplier bird) {LOST

Full Access
Question # 37

Given the code fragment:

List colors = Arrays.asList(“red”, “green”, “yellow”);

Predicate test = n - > {

System.out.println(“Searching…”);

return n.contains(“red”);

};

colors.stream()

.filter(c -> c.length() > 3)

.allMatch(test);

What is the result?

A.

Searching…

B.

Searching…Searching…

C.

Searching…Searching…Searching…

D.

A compilation error occurs.

Full Access
Question # 38

Given the code fragment:

Map books = new TreeMap<>();

books.put (1007, “A”);

books.put (1002, “C”);

books.put (1003, “B”);

books.put (1003, “B”);

System.out.println (books);

What is the result?

A.

{1007=A, 1003=B, 1002=C}

B.

{1007=A, 1003=B, 1003=B, 1002=C}

C.

{1007=A, 1002=C, 1003=B, 1003=B}

D.

{1002=C, 1003=B, 1007=A}

Full Access
Question # 39

Given:

1z0-809 question answer

What change should you make to guarantee a single order of execution (printed values 1 -100 in order)?

A.

Line 3: public synchronized void run() {

B.

Line 1: class MyClass extends Thread {

C.

Line 2: public volatile int value;

D.

Line 2: public synchronized int value;

Full Access
Question # 40

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?

A.

ur :: va

B.

ueJa

C.

The program prints nothing.

D.

A compilation error occurs at line n1.

Full Access
Question # 41

Given:

1z0-809 question answer

and the code fragment:

1z0-809 question answer

The threads t1 and t2 execute asynchronously and possibly prints ABCA or AACB.

You have been asked to modify the code to make the threads execute synchronously and prints ABC.

Which modification meets the requirement?

A.

start the threads t1 and t2 within a synchronized block.

B.

Replace line n1 with:private synchronized int count = 0;

C.

Replace line n2 with:public synchronized void run () {

D.

Replace line n2 with:volatile int count = 0;

Full Access
Question # 42

Given the definition of the Employee class:

1z0-809 question answer

and this code fragment:

1z0-809 question answer

What is the result?

A.

[sales:Ada, hr:Bob, sales:Bob, hr:Eva]

B.

[Ada:sales, Bob:sales, Bob:hr, Eva:hr]

C.

[hr:Eva, hr:Bob, sales:Bob, sales:Ada]

D.

[hr:Bob, hr:Eva, sales:Ada, sales:Bob]

Full Access
Question # 43

Given:

1z0-809 question answer

What is the result?

A.

Bar HelloFoo Hello

B.

Bar HelloBaz Hello

C.

Baz Hello

D.

A compilation error occurs in the Daze class.

Full Access
Question # 44

Given the definition of the Emp class:

public class Emp

private String eName;

private Integer eAge;

Emp(String eN, Integer eA) {

this.eName = eN;

this.eAge = eA;

}

public Integer getEAge () {return eAge;}

public String getEName () {return eName;}

}

and code fragment:

Listli = Arrays.asList(new Emp(“Sam”, 20), New Emp(“John”, 60), New Emp(“Jim”, 51));

Predicate agVal = s -> s.getEAge() <= 60;//line n1

li = li.stream().filter(agVal).collect(Collectors.toList());

Stream names = li.stream()map.(Emp::getEName);//line n2

names.forEach(n -> System.out.print(n + “ “));

What is the result?

A.

Sam John Jim

B.

John Jim

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Full Access
Question # 45

Given the code fragment:

1z0-809 question answer

Which code fragment, when inserted at line n1, enables the code to print /First.txt?

A.

Path iP = new Paths (“/First.txt”);

B.

Path iP = Paths.toPath (“/First.txt”);

C.

Path iP = new Path (“/First.txt”);

D.

Path iP = Paths.get (“/”, “First.txt”);

Full Access
Question # 46

Given the code fragment:

1z0-809 question answer

What is the result?

A.

Val:20 Val:40 Val:60

B.

Val:10 Val:20 Val:30

C.

A compilation error occurs.

D.

Val: Val: Val:

Full Access
Question # 47

Given the EMPLOYEE table;

1z0-809 question answer

Given the code fragment:

1z0-809 question answer

Assuming the database supports scrolling and updating, what is the result?

A.

The program throws a runtime exception at Line 1.

B.

A compilation error occurs.

C.

A new record is inserted and Employee Id: 102, Employee Name: Peter is displayed.

D.

A new record is inserted and Employee Id: 104, Employee Name: Michael is displayed.

Full Access
Question # 48

Given the code fragment:

1z0-809 question answer

What is the result?

A.

A compilation error occurs at line n1.

B.

courseJava

C.

Javacourse

D.

A compilation error occurs at line n2.

Full Access
Question # 49

Given:

public interface Moveable {

public default void walk (Integer distance) {System.out.println(“Walking”);)

public void run(Integer distance);

}

Which statement is true?

A.

Moveable can be used as below:Moveable animal = n - > System.out.println(“Running” + n);animal.run(100);animal.walk(20);

B.

Moveable can be used as below:Moveable animal = n - > n + 10;animal.run(100);animal.walk(20);

C.

Moveable can be used as below:Moveable animal = (Integer n) - > System.out.println(n);animal.run(100);Moveable.walk(20);

D.

Movable cannot be used in a lambda expression.

Full Access
Question # 50

Given the content:

1z0-809 question answer

and the code fragment:

1z0-809 question answer

What is the result?

A.

username = Entrez le nom d’utilisateurpassword = Entrez le mot de passe

B.

username = Enter User Namepassword = Enter Password

C.

A compilation error occurs.

D.

The program prints nothing.

Full Access
Question # 51

Given:

1z0-809 question answer

What is the result?

A.

Hi Interface-2

B.

A compilation error occurs.

C.

Hi Interface-1

D.

Hi MyClass

Full Access
Question # 52

Given that data.txt and alldata.txt are accessible, and the code fragment:

1z0-809 question answer

What is required at line n1 to enable the code to overwrite alldata.txt with data.txt?

A.

br.close();

B.

bw.writeln();

C.

br.flush();

D.

bw.flush();

Full Access
Question # 53

Given the code fragment:

1z0-809 question answer

Which code fragment, when inserted at line n1, ensures false is printed?

A.

boolean b = cs.stream() .findAny() .get() .equals(“Java”);

B.

boolean b = cs.stream() .anyMatch (w -> w.equals (“Java”));

C.

boolean b = cs.stream() .findFirst() .get() .equals(“Java”);

D.

boolean b = cs.stream() .allMatch(w -> w.equals(“Java”));

Full Access
Question # 54

Given the code fragments:

1z0-809 question answer

and

1z0-809 question answer

What is the result?

A.

FranceOptional[NotFound]

B.

Optional [France]Optional [NotFound]

C.

Optional[France]Not Found

D.

FranceNot Found

Full Access
Question # 55

Which action can be used to load a database driver by using JDBC3.0?

A.

Add the driver class to the META-INF/services folder of the JAR file.

B.

Include the JDBC driver class in a jdbc.properties file.

C.

Use the java.lang.Class.forName method to load the driver class.

D.

Use the DriverManager.getDriver method to load the driver class.

Full Access
Question # 56

Given the content of /resourses/Message.properties:

welcome1=”Good day!”

and given the code fragment:

Properties prop = new Properties ();

FileInputStream fis = new FileInputStream (“/resources/Message.properties”);

prop.load(fis);

System.out.println(prop.getProperty(“welcome1”));

System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1

System.out.println(prop.getProperty(“welcome3”));

What is the result?

A.

Good day!Testfollowed by an Exception stack trace

B.

Good day!followed by an Exception stack trace

C.

Good day!Testnull

D.

A compilation error occurs at line n1.

Full Access
Question # 57

Which two statements are true about the Fork/Join Framework? (Choose two.)

A.

The RecursiveTask subclass is used when a task does not need to return a result.

B.

The Fork/Join framework can help you take advantage of multicore hardware.

C.

The Fork/Join framework implements a work-stealing algorithm.

D.

The Fork/Join solution when run on multicore hardware always performs faster than standard sequential solution.

Full Access
Question # 58

Which two statements are true about localizing an application? (Choose two.)

A.

Support for new regional languages does not require recompilation of the code.

B.

Textual elements (messages and GUI labels) are hard-coded in the code.

C.

Language and region-specific programs are created using localized data.

D.

Resource bundle files include data and currency information.

E.

Language codes use lowercase letters and region codes use uppercase letters.

Full Access
Question # 59

Given:

1z0-809 question answer

Your design requires that:

    fuelLevel of Engine must be greater than zero when the start() method is invoked.

    The code must terminate if fuelLevel of Engine is less than or equal to zero.

Which code fragment should be added at line n1 to express this invariant condition?

A.

assert (fuelLevel) : “Terminating…”;

B.

assert (fuelLevel > 0) : System.out.println (“Impossible fuel”);

C.

assert fuelLevel < 0: System.exit(0);

D.

assert fuelLevel > 0: “Impossible fuel” ;

Full Access
Question # 60

Given:

Item table

• ID, INTEGER: PK

• DESCRIP, VARCHAR(100)

• PRICE, REAL

• QUANTITY< INTEGER

And given the code fragment:

9. try {

10.Connection conn = DriveManager.getConnection(dbURL, username, password);

11. String query = “Select * FROM Item WHERE ID = 110”;

12. Statement stmt = conn.createStatement();

13. ResultSet rs = stmt.executeQuery(query);

14.while(rs.next()) {

15.System.out.println(“ID:“ + rs.getInt(“Id”));

16.System.out.println(“Description:“ + rs.getString(“Descrip”));

17.System.out.println(“Price:“ + rs.getDouble(“Price”));

18. System.out.println(Quantity:“ + rs.getInt(“Quantity”));

19.}

20. } catch (SQLException se) {

21. System.out.println(“Error”);

22. }

Assume that:

The required database driver is configured in the classpath.

The appropriate database is accessible with the dbURL, userName, and passWord exists.

The SQL query is valid.

What is the result?

A.

An exception is thrown at runtime.

B.

Compilation fails.

C.

The code prints Error.

D.

The code prints information about Item 110.

Full Access
Question # 61

What is true about the java.sql.Statement interface?

A.

It provides a session with the database.

B.

It is used to get an instance of a Connection object by using JDBC drivers.

C.

It provides a cursor to fetch the resulting data.

D.

It provides a class for executing SQL statements and returning the results.

Full Access
Question # 62

Given:

public enum USCurrency {

PENNY (1),

NICKLE(5),

DIME (10),

QUARTER(25);

private int value;

public USCurrency(int value) {

this.value = value;

}

public int getValue() {return value;}

}

public class Coin {

public static void main (String[] args) {

USCurrency usCoin =new USCurrency.DIME;

System.out.println(usCoin.getValue()):

}

}

Which two modifications enable the given code to compile? (Choose two.)

A.

Nest the USCurrency enumeration declaration within the Coin class.

B.

Make the USCurrency enumeration constructor private.

C.

Remove the new keyword from the instantion of usCoin.

D.

Make the getter method of value as a static method.

E.

Add the final keyword in the declaration of value.

Full Access