 <p>There are different errors or mistakes in your code. I will go through them from top to bottom.</p> <ol> <li><p>Your variable <code>a</code> is never used. You could delete the whole <code>double a=sc.nextInt();</code> line without affecting your program</p></li> <li><p>Your variable <code>m</code> is not initialized and has no value when you use it the first time</p></li> <li><p>When calling a method you don't specify the data types. The data types will be taken from the variables you pass into that method. So there could be methods with the same name but with different data types in their parameter list. Imagine a method <code>int sum(int a, int b)</code> taking the parameters <code>a</code> and <code>b</code> that have to be of integer type. You can easily imagine, that there may be a situation where you don't want to sum integers but doubles. So you could look out for a method <code>double sum (double a, double b)</code> and you could use this method just like the first one but this time for variables/literals of double type. Like I wrote you don't write the data types of the parameters you pass into a method because they are determined automatically. So your <code>Math.pow(..)</code> call has to look like <code>power = Math.pow(m, n);</code></p></li> <li><p>Your code is lacking two <code>}</code> at the end (for the main method and for the class)</p></li> <li><p>Try to use self-describing names for your variables. A counter named <code>i</code> may be ok but you could easily rename <code>m</code> to <code>base</code> and <code>n</code> to <code>exponent</code> and your program would automatically be easier to read.</p></li> </ol>