# Class StackInstruction

java.lang.Object
org.apache.bcel.generic.Instruction
org.apache.bcel.generic.StackInstruction

All Implemented Interfaces:
  `Cloneable`

Direct Known Subclasses:
  `DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, POP, POP2, SWAP`

public abstract class StackInstruction extends Instruction
Super class for stack operations like DUP and POP.

- ## Field Summary

  ### Fields inherited from class Instruction

  `length, opcode`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `StackInstruction(short opcode)`
  Constructs a StackInstruction.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Type`
  `getType(ConstantPoolGen cp)`
  Gets the type.

  ### Methods inherited from class Instruction

  `accept, consumeStack, copy, dump, equals, getComparator, getLength, getName, getOpcode, hashCode, initFromFile, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString, toString, toString`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### StackInstruction

    protected StackInstruction(short opcode)
    Constructs a StackInstruction.
    Parameters:
      `opcode` - instruction opcode.

- ## Method Details

  - ### getType

    public Type getType(ConstantPoolGen cp)
    Gets the type.
    Parameters:
      `cp` - the constant pool.
    Returns:
      Type.UNKNOWN.