public static class Entry
{
public Entry(int key)
{
this.key = key;
next = null;
} public final int getKey()
{
return key;
} private int key;
private Entry next;
}How to translate the class of in Java into Class of C++
Thanks
{
public Entry(int key)
{
this.key = key;
next = null;
} public final int getKey()
{
return key;
} private int key;
private Entry next;
}How to translate the class of in Java into Class of C++
Thanks
If the later ,It's easy!
public:
Entry(int key) : key(key), next(0) { }
int getKey() { return key; }
private:
int key;
Entry *next;
};不过,放到工程环境中可能会有所不同。