public static void main ( String args [ ] ) {
  int numRay [ ] = {
    0 , 4 , 3 , 2 , 7 , 8 , 2 , 3 , 1 };
    for ( int i = 0 ;
    i < numRay . length ;
    i ++ ) {
      numRay [ numRay [ i ] % numRay . length ] = numRay [ numRay [ i ] % numRay . length ] + numRay . length ;
    }
    System . out . println ( "The repeating elements are : " ) ;
    for ( int i = 0 ;
    i < numRay . length ;
    i ++ ) {
      if ( numRay [ i ] >= numRay . length * 2 ) {
        System . out . println ( i + " " ) ;
      }
    }
  }
  
public static void main ( String args [ ] ) { int numRay [ ] = { 0 , 4 , 3 , 2 , 7 , 8 , 2 , 3 , 1 } ; for ( int i = 0 ; i < numRay . length ; i ++ ) { numRay [ numRay [ i ] % numRay . length ] = numRay [ numRay [ i ] % numRay . length ] + numRay . length ; } System . out . println ( " The ▁ repeating ▁ elements ▁ are ▁ : ▁ " ) ; for ( int i = 0 ; i < numRay . length ; i ++ ) { if ( numRay [ i ] >= numRay . length * 2 ) { System . out . println ( i + " ▁ " ) ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_initializer (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal) (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (field_access object: (identifier) field: (identifier))))))) (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))))))))