Question: Noob question.

I have been programming at basic level for quite a while but I have trouble understanding class data type.

when we say `int a = 9;`
it means a is of data type int meaning it can contain only integers.

like wise for String, boolean, double, float etc.

But consider the following code:

```
Class Node {

Node next = null;
int data;

public Node(int d){ data = d; }

void append(int d)
    {
        blah blah blah
        ..............
    }
}

```

What does `Node next = null;` mean? I can understand the effort to create an object with

```
Node next = new Node();

```

and then try to manipulate the next object.

Answer: 
The line

```
Node next = null;

```

means that you define a variable `next` which holds only references to objects of type (the class) `Node`. Additionally you initialize it with the `null` value which means `no object created yet`. 

Those variables actually hold references to objects and `null` is a special value valid only for objects which indicates that your variable is empty. This something like `next.append()` will fail with a nullpointer exception if `next` is still `null`.
Node next = null; is a sort of pointer to a NodeObject. It's like declaring a variable not still initialized. 
In this case the object will probably be instantiated later.
If you put an already existing object to a null value, if there aren't other references to the same object, then the garbage collector deletes it.

> 
> I have been programming at basic level for quite a while but I have trouble understanding class data type.
>  when we say int a = 9; it means a is of data type int meaning it can contain only integers.
>  like wise for String, boolean, double, float etc.
> 
> 
> 

Pay attention that int and Integer are different in Java. int is a primitive type and it isn't an object. Integer is an object you can instantiate with new operator.