I'm working on an implementation of a double ended queue. I have a class Deque that has an inner class Node to represent the items on the list. I declare the class within Deque (itself a public class) like this:
public class Node(){
//
}
Now creating new nodes with basic object creation syntax is simple within the Deque class itself:
Node newNode = newNode(arg1);
However, I want to be able to declare new Nodes from a separate class, a DequeTest class that provides unit testing. When I attempt to create a new Node with the above syntax, I get an error saying that the Node class is not visible. I'm working on a pre-defined API, so I can't create any new public methods. Would a private createNode() method that returns a new Node be optimal? Even that seems like it wouldn't work, because the compiler throws an error when I even use the Node keyword.