I keep getting this error: PowerJDialog.java:28: error: cannot find symbol
if (p.Power(pow))
^
symbol: method Power(int)
location: variable p of type Power
1 error
Tool completed with exit code 1
I have no idea what it means or how to fix it. In my Java book it has no solution to this error, here is my code:
import javax.swing.JOptionPane; //Louis Friedmann //July 16, 2013 //This proragm asks for the number and expontant and outputs the result public class PowerJDialog { public static void main(String[] args) { //Variables Declaration String inputString; //input int a; //base number int n; // exponant number int pow; //power String powerResult; // give the reuslt as math //Input inputString = JOptionPane.showInputDialog("Please enter a number"); a = Integer.parseInt(inputString); inputString = JOptionPane.showInputDialog("Please enter a multiplier?"); n = Integer.parseInt(inputString); //Calculation Power p= new Power(a,n); //create new object if (p.Power(pow)) { powerResult = a + " power " + n + " is " + Math.pow(a,n); } //Output JOptionPane.showMessageDialog(null, powerResult); //exits the program System.exit(0); } }
Any ideas of what could be going wrong?