View Single Post
Old Nov 6th, 2006, 10:41 AM   #16
deanosrs
Programmer
 
deanosrs's Avatar
 
Join Date: Apr 2006
Location: Bristol, UK
Posts: 31
Rep Power: 0 deanosrs is on a distinguished road
Send a message via MSN to deanosrs
the source code is above, still stuck with this...

I think I'm closer to understanding it though. Basically I want an array of ArrayLists, each of which needs to contain an "Edge" (my class). It needs to be so that the arraylists can only contain edges otherwise it whinges at me when I try to add an edge to it. However when I put <Edge> in the initial array definition it creates an error of generic array creation - that I'm trying to create an array of more than one type, which is wrong I want an array of ArrayLists but I want each of them to only contain edges!

I think this is the culprit line...

ArrayList[] graph = new ArrayList[nodeno];

Last edited by deanosrs; Nov 6th, 2006 at 10:59 AM.
deanosrs is offline   Reply With Quote