Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

task 2 java lang 6:03 map = new HashMap 0; map.put(7, Marty); map.put( 34, Louann); map.put(27, Donald); map.put(15, Moshe); map.put(84, Larry'); map.put(7,Ed); map.put(2350, Orlando); map.remove();

task 2 java lang
image text in transcribed
image text in transcribed
6:03 map = new HashMap0; map.put(7, "Marty"); map.put( 34, "Louann"); map.put(27, "Donald"); map.put(15, "Moshe"); map.put(84, "Larry'); map.put(7,"Ed"); map.put(2350, "Orlando"); map.remove(); map.put(s, "Moshe"); map.remove(84); map.put(17, "Steve"); System.out.println(map); } } 2.1. What keys are in this map after the program runs? 2.2. What values are contained in the map after the program runs? 2.3. There are two "put" commands with key 7. Why is there only one value for key 7 stored in the map? 2.4. Are the values in a HashMap stored in sorted order? D Dashboard Calendar To-do Notifications 6:03 W08 Lab Sets, Maps, Hashes.docx } 2.1. What keys are in this map after the program runs? 2.2. runs? What values are contained in the map after the program 2.3. There are two "put" commands with key 7. Why is there only one value for key 7 stored in the map? 2.4. Are the values in a HashMap stored in sorted order? 2.5. When you issue a put command with a key that is already in the HashMap, Java returns the old value. Do you have to do anything with this returned value? (Hint: is the return value from map.put(7, "Ed"); assigned or output in the above program?) Rubric: Student name and today's date is a comment in the first line of the programs: -5 points if fails Screenshot and program code: -5 points if fails . Five questions: 2 point each . Please paste a screenshot of a successful program run, and copy-and-paste the source code from your.java file, here. Task 3. Iterators (5 points) 3.1. In your own words, describe what each iterator method does: Retus true D Dashboard Calendar To-do Notifications

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

ISBN: 0132742926, 978-0132742924

More Books

Students also viewed these Databases questions