Search:

Type: Posts; User: pbrockway2

Search: Search took 0.15 seconds.

  1. Re: Why use "new" operator with an instance variable of array type in accessor methods?

    Either use the Arrays.toString() method, or use a for loop to build up or display your string.
  2. Re: Why use "new" operator with an instance variable of array type in accessor methods?

    ToyExample eg = new ToyExample(666);
    Date[] arr = eg.getDateArray();

    arr[42] = new Date(); // this will *not* change the array entry in the ToyExample instance
  3. Re: Why use "new" operator with an instance variable of array type in accessor methods?

    In fact it is on line 23 that they create the new object they will return (temp). The for loop is used to populate this new array with new Date objects.

    The reason is so that the caller does not...
Results 1 to 3 of 3