ForLoopTree (Compiler Tree API )
Keywords: com.sun.source.tree.ForLoopTree interface
Date: 2026-04-17

com.sun.source.tree

## Interface ForLoopTree

- All Superinterfaces:
    StatementTree, Tree

      @Exported
      public interface ForLoopTree
      extends StatementTree

  A tree node for a basic 'for' loop statement. For example:

         for ( initializer ; condition ; update )
             statement

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

- - ### 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
    --- | ---
    `ExpressionTree` | `getCondition()`
    `List<? extends StatementTree>` | `getInitializer()`
    `StatementTree` | `getStatement()`
    `List<? extends ExpressionStatementTree>` | `getUpdate()`

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

      `accept, getKind`

- - ### Method Detail

    - #### getInitializer

          List<? extends StatementTree> getInitializer()

    - #### getCondition

          ExpressionTree getCondition()

    - #### getUpdate

          List<? extends ExpressionStatementTree> getUpdate()

    - #### getStatement

          StatementTree getStatement()

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