1Z0-805 · Question #59
Consider the following database table: Inventory Table Item_ID, Integer: PK Item_name, Varchar (20) Price, Numeric (10, 2) Quan, Integer Consider the following method that updates the prices in the…
The correct answer is D. 1. HashMap<Integer, Float> newPrices. The first line should be HashMap<Integer, Float> newPrices, as in SQL numeric represent a float number, not an integeror string. We also make sure to use floatValue() both in appropriate places Note: Map is an object that maps keys to values. A map cannot contain duplicate…
Question
Consider the following database table:
Inventory Table
- Item_ID, Integer: PK
- Item_name, Varchar (20)
- Price, Numeric (10, 2)
- Quan, Integer
Consider the following method that updates the prices in the Inventory table:
public static void updatePrices{ // #1: missing line Connection con) throws SQLException { // #2: missing line PreparedStatement updatePrices = con.prepareStatement (updatePricesString); // #3: missing line { // #4: missing line updatePrices.executeUpdate(); } } This method us missing four lines, which group of lines complete this method? Oracle 1Z0-805 Exam
Options
- A
- HashMap<Integer, String> newPrices,
- B
- HashMap<Integer, Float> newPrices,
- CgetKey().intValue());
- D
- HashMap<Integer, Float> newPrices,
- E
- HashMap<Integer, Float> newPrices,
- Fgetvalue().floatValue()
- G
- HashMap<Integer, String> newPrices,
- H
- HashMap<Integer> newPrices,
How the community answered
(40 responses)- A3% (1)
- B5% (2)
- D80% (32)
- F3% (1)
- G10% (4)
Explanation
The first line should be HashMap<Integer, Float> newPrices, as in SQL numeric represent a float number, not an integeror string. We also make sure to use floatValue() both in appropriate places Note: Map is an object that maps keys to values. A map cannot contain duplicate keys: Each key can map to at most one value. It models the mathematical function abstraction.
Topics
Community Discussion
No community discussion yet for this question.