stack

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    stack

    Code:
    public IAbstractQueryResult pop () {
    I want the pop function to return IAbstractQueryR esult ?
    How do i do that? in
    Code:
    public class QResStack
    ca n i cast the lifo = new Stack(); somehow
  • chaarmann
    Recognized Expert Contributor
    • Nov 2007
    • 785

    #2
    Just see if class Stack implements the interface IAbstractQueryR esult. If yes, just cast it.
    If no, then make your own new class (let's say AbstractQuerySt ack) that extends Stack and implements IAbstractQueryR esult. When you assing lifo= new AbstractQuerySt ack() then you can cast lifo to IAbstractQueryR esult.

    Comment

    Working...