Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
java class hierarchy
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Joshua Cranmer, post: 2980447"] What do you mean, "Not a symbol because it is abstract"? Any type can be used for reference, including abstract classes and interfaces. This would be partial code for what I think you want to do: LinkedList<Symbol> stack = new LinkedList<Symbol>(); Queue<Symbol> queue = new LinkedList<Symbol>(); // ... Fill queue ... while (!queue.isEmpty()) { Symbol head = queue.remove(); if (head instanceof Operand) { stack.addLast(head); } else if (head instanceof Function) { // ... manipulate stack, etc. } } [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
java class hierarchy
Top