2 Replies Latest reply: Mar 29, 2007 9:55 AM by 807599 RSS

    initialization of a instance variable outside the constructor

    807599
      hi,

      I have this class Table
      public class Table{
      
      public static final int capacity = 27;
      private Node[] data = new Node[capacity];
      
      public Table()
      //post: has constructed an empty Table object
      {
      for(int i = 0; i < capacity;i++)
                    data[i] = null;
      
      }
      is this part:
      for(int i = 0; i < capacity;i++)
                    data[i] = null;
      needed? I don't think so, but I'm not very sure about that.