How to make a power method without for loops or recursion?
<p>I'm thinking of a method that calculates the power (base 10 only) of an integer which will be passed as an argument but without using for loops or recursion:</p>

<p>here's the method in it's simplest form using forr loop:</p>

<pre><code> static long power(int val) {
    long y = 10l;

    if (val == 1) {
        return y;
    } else {
        for (int x = 0; x &lt; val - 1; x++) {
            y *= 10;

        }
        return y;

    }
}
</code></pre>
