having a powers of 2 questions <pre><code> import acm.program.*; public class Practice3 extends ConsoleProgram { public static int powersOf2(int k) { int x = 0; while (k &lt; 1000) { x = k; k *= 2; } return x; } public void run() { println(powersOf2(1)); println(powersOf2(0)); println(powersOf2(2)); println(powersOf2(-1)); println(powersOf2(3000)); } </code></pre> <p>I don't think I really get right values from <code>powersOf2</code>. Only 512 is displayed when I run program. And if I run it by each <code>println</code>, it gives me:</p> <pre><code>512 none 512 none 0 </code></pre> <p>Is there something wrong? or values are correct?</p>