2 Dimensional Array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

2 Dimensional Array

tguedestguedes TampaPosts: 0Member

I'm creating a program for my mom in which she wants to enter her employees and the house they cleaned and based on this, it will calculate the pay for each employee. The employee needs to be tied to the house they cleaned so I was thinking of creating a 2d array with this info. But since she will be entering the names of the employees before she enters the houses, is it possible for me to create the first part of the array, and then later fill in the 2nd part of the array?

I'm not sure if I'm making myself clear and I would like to post the code that I have so far but this is my first post on this site and I'm not sure how to put in the code.


  • PLuzPLuz PortugalPosts: 1Member

    I believe that what you need is an Hashmap.

  • PaulPaul EcuadorPosts: 1Member

    maybe you need use a hashmap or create a class of employees with houses as attributes, and create a unidimensional array of employees or include a hashmap. As a personal view, I would consider create a class diagram first before develop that and put the class instances into a hashmap.

    But if you need use 2 dimensional arrays exclusively, you can instance the second part with a clean String "" or with other value that you can replace it posteriorly.

  • PremsaiPremsai NellorePosts: 2Member

    If you need more information on a two dimensional please visit http://java.meritcampus.com/t/33/Multi-dimensional-array

Sign In or Register to comment.