G
Guest
Can someone tell me what I am doing wrong here? This will not compile
because of line 2, but if I replace with Service.ContactTO[] contacts = null;
it will through an exception on line 3.
Thanks
1Service.ContactTO cntTO = new Service.ContactTO();
2 Service.ContactTO[] contacts = new Service.ContactTO();
3 contacts[0] = createNewContact1();
4 private Service.ContactTO createNewContact1()
5 {
6 Service.ContactTO cnt = new Service.ContactTO();
7 cnt.firstName = "Neil";
8 cnt.lastName = "Armstrong";
9 cnt.prefix = "Mr.";
10 return cnt;
}
because of line 2, but if I replace with Service.ContactTO[] contacts = null;
it will through an exception on line 3.
Thanks
1Service.ContactTO cntTO = new Service.ContactTO();
2 Service.ContactTO[] contacts = new Service.ContactTO();
3 contacts[0] = createNewContact1();
4 private Service.ContactTO createNewContact1()
5 {
6 Service.ContactTO cnt = new Service.ContactTO();
7 cnt.firstName = "Neil";
8 cnt.lastName = "Armstrong";
9 cnt.prefix = "Mr.";
10 return cnt;
}