• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Map Application examples

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there

Am new to the forum, having been a long time lurker. i am looking for some help regarding a scenario I need to come up with to create a basic map application

I need to come up with a scenario for small application that makes use of a map and provides the user with the ability to store, manipulate and extract data.

The type of map can be(sorted or unsorted), the keys must be of type String or Integer. The values must be of a collection type from the Collections Framework.

Ideally I am looking for only one class and for it to be really basic, My mind is at a complete blank, I would appreciate a few points in the right direction, I am very new to java as this post probably show lol

Any help would be greatly appreciated.

(Go easy on me)

 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, Welcome to the Ranch. We always go easy on greenhorns, so don't worry.

Is your "blankness" about how to use maps in Java? if so, this tutorial should help. Or is it about how such a map might be used? What about how to structure that would track the books a person had? The key would be the person's name and the value would be a list of books.
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Key=name, Value=address.
Key=name, Value=phone number.

There are two more simple uses.
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but "the values must be of a collection type from the Collections Framework," so I suggested a list.
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I missed the bit about a Collection. Sorry. Can you create such a Map with a Stream? It turns out to be very complicated, taking a total of three lines to write here.
 
rosso bianchi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies
 
rosso bianchi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to come up with something in relation to the sporting world
 
Hold that thought. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic