import java.util.*;
public class List
{
public static INode head;
public List()
{
head = new INode(8);
}
public static void main (String[] args)
{
INode a = new INode(8);
int data = a.getValue();
System.out.println(data);
System.out.println(head.getValue());
}
}
And my Node class:
public class INode
{
private int value;
private INode right, down;
private int row, col;
public INode(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
public void setValue(int value)
{
this.value = value;
}
public INode getRight()
{
return right;
}
public void setRight(INode right)
{
this.right = right;
}
public INode getDown()
{
return down;
}
public void setDown(INode down)
{
this.down = down;
}
public int getRow()
{
return row;
}
public void setRow(int row)
{
this.row = row;
}
public int getCol()
{
return col;
}
public void setCol(int col)
{
this.col = col;
}
}
Yea, head give me null, while a give me 8... can someone explains it to me?