Constant (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.tomcat.util.bcel.classfile, class: Constant

# Class Constant

java.lang.Object
org.apache.tomcat.util.bcel.classfile.Constant

Direct Known Subclasses:
  `ConstantClass, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantUtf8`

public abstract class Constant extends Object
Abstract superclass for classes to represent the different constant types in the constant pool of a class file. The classes keep closely to the JVM specification.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final byte`
  `getTag()`
  Gets the tag of constant.
  `String`
  `toString()`

  ### Methods inherited from class Object

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

- ## Method Details

  - ### getTag

    public final byte getTag()
    Gets the tag of constant.
    Returns:
      Tag of constant, that is, its type. No setTag() method to avoid confusion.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`