I've looked all around and it seems I have the proper syntax:
QueueOfChars queue = new QueueOfChars();
QueueOfChars.QueueOfCharsNode charNode = queue.new QueueOfCharsNode();
However I get a compiling error with the charNode object I try to create
Driver3.java:22: error: constructor QueueOfCharsNode in class
QueueOfChars.QueueOfCharsNode cannot be applied to given types;
QueueOfChars.QueueOfCharsNode charNode = queue.new QueueOfCharsNode();
required: char
found: no arguments
reason: actual and formal argument lists differ in length
1 error
It's getting this error because I have a QueueOfCharsNode(char ch)
public class QueueOfChars{
public class QueueOfCharsNode{
QueueOfCharsNode next;
QueueOfCharsNode prev;
char c;
public QueueOfCharsNode(char ch){ //line causing the error
c = ch;
next = prev = null;
}
How do I get it to just read the "public class QueueOfCharsNode" line when I'm making the object for it?