The code is too big to paste the entire when i am having one error at Line 20 that says:
"cannot make static reference to non-static Integer"
I'm use to C but so I'm not use to having to putting the word static in places.
private static void createTree(){
ArrayList arrayOfInts = new ArrayList();
T t = new T();
TreeNode root = t.getRoot();
System.out.println("Please enter a list of integers:");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String result = null;
try {
while((result = in.readLine()) !=null)
{
Integer intResult = Integer.parseInt(result); //error: cannot make static reference to non-static Integer
// Integer intResult = result; //error: cannot make static reference to non-static Integer
System.out.println("intResult:"+intResult);
// insertInOrder(root, intResult);
}
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//this means your done inputing.
//this means your done inputing.
}
/**
* Instantiates a new t.
*/
public T()
{
super();
root = new TreeNode();
}