hello,
I have called getFruits method from another class (another class is called vegetables). I can't seem to add the names of the fruits in myTable TreeSet in class Test. The error I am getting is "cannot find symbol - variable length". Can anyone help me. Thanks
public class Test
{
private static TreeSet<String> myTable = new TreeSet<String>();
public Test()
{
super();
myTable = new TreeSet<String>();
}
public static void shoppingList()
{
vegetables calling = new vegetables();
System.out.println(" " + calling.getFruits()); // used this to test if I able to
// call the method from another class
for (int i = 0; i < calling.length; i++) // here is there error occuring
{
myTable.add(calling[i]);
}
}
}