| Article: |
Making Java Objects Comparable | |
| Subject: | Hi, what if my array size is 30 but onli the first 2 has contents? | |
| Date: | 2007-08-31 21:48:12 | |
| From: | tiongsquare | |
| Example Customer[] Cust = new Customer[10]; <- i find that if i pre initialize the arraysize to be 30, and if only the first 2( 0 and 1) has contents, when the comparator trys to get Name = ((Customer) anotherCustomer).getname().toUpperCase(); of the "null" array, error will occur. is there anyway for the comparator to know that the next is empty array and end the compare operation to return back? thanks! | ||
Women in Technology
Hear us Roar
