static void printDiamond ( int n ) {
  int space = n - 1 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    for ( int j = 0 ;
    j < space ;
    j ++ ) System . out . print ( " " ) ;
    for ( int j = 0 ;
    j <= i ;
    j ++ ) System . out . print ( "* " ) ;
    System . out . print ( "\n" ) ;
    space -- ;
  }
  space = 0 ;
  for ( int i = n ;
  i > 0 ;
  i -- ) {
    for ( int j = 0 ;
    j < space ;
    j ++ ) System . out . print ( " " ) ;
    for ( int j = 0 ;
    j < i ;
    j ++ ) System . out . print ( "* " ) ;
    System . out . print ( "\n" ) ;
    space ++ ;
  }
}

static void printDiamond ( int n ) { int space = n - 1 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < space ; j ++ ) System . out . print ( " ▁ " ) ; for ( int j = 0 ; j <= i ; j ++ ) System . out . print ( " * ▁ " ) ; System . out . print ( " \n " ) ; space -- ; } space = 0 ; for ( int i = n ; i > 0 ; i -- ) { for ( int j = 0 ; j < space ; j ++ ) System . out . print ( " ▁ " ) ; for ( int j = 0 ; j < i ; j ++ ) System . out . print ( " * ▁ " ) ; System . out . print ( " \n " ) ; space ++ ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) (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: (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 (string_literal)))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (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: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) (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: (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 (string_literal)))) (expression_statement (update_expression (identifier)))))))