Share
Explore BrainMass

Example of How to Implement Array in Java

If I were to describe an every day situation, like being a chef at a restaurant, how would I implement an array (for inventory) of my spices (I would have a total of 20 spice bottles)? And, how would items in the array might be searched for or sorted?

I don't need a full program, I just need pseudocode - a small example of just the possible array.

Solution Preview

I have in fact coded the whole program for you.

I thought it would be easier for you test and understand the program when you execute the attached class file in a java VM. Feel free to add 10 more spices (I have run out of names:)

Hope it helps. If you like it please leave comment and reserve future problems for me.

public class spice {
public static String [] arrSpice;

/**
* @param args
*/
public static void ...

Solution Summary

I have in fact coded the whole program for you.

I thought it would be easier for you test and understand the program when you execute the attached class file in a java VM. Feel free to add 10 more spices (I have run out of names:)

$2.19