PDA

View Full Version : Java code problems


g_hadgraft
04-26-2005, 08:21 PM
Im having some trouble with my java code i have a class which creates an abstract data type, this class is then used from another class using this line
IntArrayBag bag1 = new IntArrayBag();

The constructor this is using from the first class is

public class IntArrayBag implements Cloneable
{

int[] data;
int capacity;
int presentItems;


public IntArrayBag()
{
data=new int[10];
presentItems=0;
}
}

This is not the whole class just the constructor this line uses.

However the problem with this code is that it throws up the error cannot resolve symbol class IntArrayBag

suryad
04-27-2005, 04:48 AM
From your code nothing seems to be wrong because I executed your code. So unless you are more specific I dont know if I can help out. More info would be great. Your code is correct as of what you posted. What I did was create a main and instantiate an instance of IntArrayBag and it worked fine. No errors.