LineNumber (Java SE 23 & JDK 23)
Description: declaration: module: java.base, package: java.lang.classfile.instruction, interface: LineNumber
Keywords: java.lang.classfile.instruction.LineNumber interface

# Interface LineNumber

All Superinterfaces:
  `ClassFileElementPREVIEW`, `CodeElementPREVIEW`, `PseudoInstructionPREVIEW`

public sealed interface LineNumber extends PseudoInstructionPREVIEW
`LineNumber` is a preview API of the Java platform.
Programs can only use `LineNumber` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A pseudo-instruction which models a single entry in the `LineNumberTableAttribute`PREVIEW. Delivered as a `CodeElement`PREVIEW during traversal of the elements of a `CodeModel`PREVIEW, according to the setting of the `ClassFile.LineNumbersOption`PREVIEW option.

Since:
  22
See Also:
  - `PseudoInstruction`PREVIEW

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `line()`
  Returns the line number.
  `static LineNumberPREVIEW`
  `of(int line)`
  Returns a line number pseudo-instruction.

- ## Method Details

  - ### line

    int line()
    Returns the line number.
    Returns:
      the line number

  - ### of

    static LineNumberPREVIEW of(int line)
    Returns a line number pseudo-instruction.
    Parameters:
      `line` - the line number
    Returns:
      a line number pseudo-instruction