- Sep 21, 2011
- 285
- 0
- 0
I understand what 'this' is meant to accomplish, but I'm sort of confused as far as the conventions for using it. normally, if I'm referring to anything in a class, i precede it with 'this'. for example:
to summarize my question, what is the major difference in 'this.size' or just using 'size' to refer to that variable?
Code:
public class linkedList {
private class listNode
{
private Object item;
private listNode next;
private int size;
listNode()
{
this.item = null;
this.next = null;
this.size = 0;
}
listNode(Object _item, listNode _next)
{
this.item = _item;
this.next = _next;
size = 0;
}
}
