public static void StarPattern ( int height ) {
  for ( int i = 0 ;
  i < height ;
  i ++ ) {
    for ( int j = height - 1 ;
    j > i ;
    j -- ) {
      System . out . print ( "*" ) ;
    }
    boolean printChar = false ;
    for ( int j = 0 ;
    j < ( ( i * 2 ) + 1 ) ;
    j ++ ) {
      if ( printChar ) {
        System . out . print ( "*" ) ;
      }
      else {
        System . out . print ( i + 1 ) ;
      }
      printChar = ! printChar ;
    }
    for ( int j = height - 1 ;
    j > i ;
    j -- ) {
      System . out . print ( "*" ) ;
    }
    System . out . println ( ) ;
  }
}

public static void StarPattern ( int height ) { for ( int i = 0 ; i < height ; i ++ ) { for ( int j = height - 1 ; j > i ; j -- ) { System . out . print ( " * " ) ; } boolean printChar = false ; for ( int j = 0 ; j < ( ( i * 2 ) + 1 ) ; j ++ ) { if ( printChar ) { System . out . print ( " * " ) ; } else { System . out . print ( i + 1 ) ; } printChar = ! printChar ; } for ( int j = height - 1 ; j > i ; j -- ) { System . out . print ( " * " ) ; } System . out . println ( ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (identifier)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))))))