Hi all!!
i'm new to java and i got a simple question.
how does pointers work in java?
let say i want to creat a link list...with nodes...in C++, it'll look like this:
class Node
{
public:
// constructors
Node():
next(this),prev(this){};
Node(const ItemType data):
item(data),next(NULL),prev(NULL){};
// public data members
ItemType item;
Node* next;
Node* prev;
};
does java have * ? i know java has ArrayList class and stuff like that, but what if i want to creat one from scratch?
i'm new to java and i got a simple question.
how does pointers work in java?
let say i want to creat a link list...with nodes...in C++, it'll look like this:
class Node
{
public:
// constructors
Node():
next(this),prev(this){};
Node(const ItemType data):
item(data),next(NULL),prev(NULL){};
// public data members
ItemType item;
Node* next;
Node* prev;
};
does java have * ? i know java has ArrayList class and stuff like that, but what if i want to creat one from scratch?