0

My current class project is dealing with hashtables. We are able to use whatever language we want, however the professor uses c++.

This is the sample code he provided us that we are supposed to copy over:

 for(int i = 0; i < size; i++)
      this->theTable[i] = EMPTY;

He says this will set the array, theTable, to empty.

How am I supposed to do this in Java? Isn't an array in Java always set to 0 if its empty? Is this code equivalent?

 for(int i = 0; i < size; i++) {
           this.theTable[i] = 0;
 }
johntc121
  • 199
  • 1
  • 2
  • 11

0 Answers0