2 Dimensional Array

tguedestguedes Tampa

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 Portugal

    I believe that what you need is an Hashmap.

  • PaulPaul Ecuador

    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 Nellore

    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.

Howdy, Stranger!

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