TryTree (Compiler Tree API )
Keywords: com.sun.source.tree.TryTree interface
Date: 2026-01-21

com.sun.source.tree

## Interface TryTree

- All Superinterfaces:
    StatementTree, Tree

      @Exported
      public interface TryTree
      extends StatementTree

  A tree node for a 'try' statement. For example:

         try
             block
         catches
         finally
             finallyBlock

  Since:
    1.6
  See The Java™ Language Specification:
    section 14.20

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.sun.source.tree.Tree

      `Tree.Kind`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `BlockTree` | `getBlock()`
    `List<? extends CatchTree>` | `getCatches()`
    `BlockTree` | `getFinallyBlock()`
    `List<? extends Tree>` | `getResources()`

    - ### Methods inherited from interface com.sun.source.tree.Tree

      `accept, getKind`

- - ### Method Detail

    - #### getBlock

          BlockTree getBlock()

    - #### getCatches

          List<? extends CatchTree> getCatches()

    - #### getFinallyBlock

          BlockTree getFinallyBlock()

    - #### getResources

          List<? extends Tree> getResources()

Copyright © 2005, 2026, Oracle and/or its affiliates. All rights reserved.