Hi, I'm trying cattle drive exercise. Below is the code I write for assignment 5. I got a exeption said NullPointerException at line 6. Can anybody tell me the problem?Thank you. [ code removed -ds ] [ September 30, 2002: Message edited by: Dirk Schreckmann ]
You instanciate you array 'arr' with the following line: [ code removed ] Then you set values with: [ code removed ] but the second dimension of your array is never allocated. You should write something like [ code removed ] if you want the same dimension for each row, or [ code removed ] if you want different size for each row. W. [ September 30, 2002: Message edited by: Dirk Schreckmann ]
pgup down, Welcome to JavaRanch! We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy. Thanks Pardner! Hope to see you 'round the Ranch! ------------------------- Please do not post code related to Cattle Drive assignments. Also, please don't otherwise share solutions on the forum.