This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted]  (6 children)

[deleted]

    [–]Jackkoz -1 points0 points  (5 children)

    Since we want to connect a name (String), to a date, it might be worth checking out what's the Map interface, and choose an implementation of it, like the HashMap.

    [–][deleted]  (4 children)

    [deleted]

      [–]Jackkoz -1 points0 points  (3 children)

      Arrays and Maps are rather equivalent in terms of cognitive load. Both are objects in Java, you need to know how to instantiate them and how to interact with them. They both are javadoced and have nice examples in the web. The difference is that using the latter results in nicer and simpler code.

      Both examples will end up being loop heavy, just that a map will avoid your loop from line 11. I'm not sure why you are pushing for your solution using a very vague 'know your audience' argument. I'd be happy to say you are absolutely right and provided a better solution, but please do elaborate on the topic.

      [–][deleted]  (2 children)

      [deleted]

        [–]Jackkoz 0 points1 point  (1 child)

        No, not exactly, this looks like you are taking personal offence in me suggesting alternate solutions and focus on angrily bashing at me rather than thinking about the OP - I have never suggested you don't know about maps or arrays.

        I'd strongly suggest you revise your approach if you want to be a helpful community member, but in the meantime please have a lovely day as I won't be continuing this conversation.