Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 17 Assume that the following code has been executed (same for Questions 17 thru 20) : HashMap places = new HashMap (); places.put( origin,

Question 17

Assume that the following code has been executed (same for Questions 17 thru 20):

HashMap places = new HashMap(); places.put( "origin", new Point() ); places.put( "east", new Point( 100, 0 ) ); places.put( "south", new Point( 0, -100 ) ); places.put( "northwest", new Point( -100, 100 ) ); places.put( "east", new Point( 200, 0 ) ); 

What value is returned by the following method call? places.size()

1
4
0
5

Question 18

Assume that the following code has been executed (same for Questions 17 thru 20):

HashMap places = new HashMap(); places.put( "origin", new Point() ); places.put( "east", new Point( 100, 0 ) ); places.put( "south", new Point( 0, -100 ) ); places.put( "northwest", new Point( -100, 100 ) ); places.put( "east", new Point( 200, 0 ) ); 

What value is returned by the following method call?

places.get( "south" )

a Point object located at (100.0, 0.0)
null
a Point object located at (0.0, -100.0)
a Point object located at (0.0, 0.0)

Question 19

Assume that the following code has been executed (same for Questions 17 thru 20):

HashMap places = new HashMap(); places.put( "origin", new Point() ); places.put( "east", new Point( 100, 0 ) ); places.put( "south", new Point( 0, -100 ) ); places.put( "northwest", new Point( -100, 100 ) ); places.put( "east", new Point( 200, 0 ) ); 

What value is returned by the following method call? places.get( "east" )

a Point object located at (100.0, 0.0)
null
a Point object located at (200.0, 0.0)
a Point object located at (0.0, 0.0)

Question 20

Assume that the following code has been executed (same for Questions 17 thru 20):

HashMap places = new HashMap(); places.put( "origin", new Point() ); places.put( "east", new Point( 100, 0 ) ); places.put( "south", new Point( 0, -100 ) ); places.put( "northwest", new Point( -100, 100 ) ); places.put( "east", new Point( 200, 0 ) ); 

What value is returned by the following method call? places.get( "north" )

a Point object located at (0.0, 0.0)
a Point object located at (-100.0, 100.0)
a Point object located at (100.0, 0.0)
a Point object located at (0.0, 100.0)
null

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_2

Step: 3

blur-text-image_3

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago