title: Armstrong Number Checker in Java
body: <p>I am still somewhat of a beginner to Java, but I need help with my code. I wanted to write an Armstrong Number checker.</p>
  <blockquote>
  <p>An Armstrong number is one whose sum of digits raised to the power three equals the number itself. 371, for example, is an Armstrong number because 3^3 + 7^3 + 1^3 = 371.</p>
  </blockquote>
  <p>If I understand this concept correctly, then my code should work fine, but I don't know where I made mistakes. I would appreciate if you could help correct my mistakes, but still kind of stick with my solution to the problem, unless my try is completely wrong or most of it needs to change.</p>
  <p>Here is the code:</p>
  <pre class="lang-java prettyprint-override"><code>public class ArmstrongChecker {
      
       boolean confirm = false;
       Integer input;
       String converter;
       int indices;
       int result = 1;
      
       void ArmstrongCheck(Integer input) {
          this.input = input;
          converter = input.toString();
          char[] array = converter.toCharArray();
          indices = array.length;
          result = (int) Math.pow(array[0], indices);
          
          for (int i = 1; i &lt; array.length; i++) {
              result = result + (int) Math.pow(array[i], indices);
          }
          if (result == input) {
              confirm = true;
              System.out.println(confirm);
          } else {
              System.out.println(confirm);
          }
      }
  }
  </code></pre>
  <p>For my tries I used '153' as an input. Thank you for your help!</p>