the first problem with your code is you did not declare the variable prod, this would give you an error while compiling.you are also telling the computer to print out "prod = prod * a" as a string so you would not see any results even if your code was functioning.
first off you need to write a method named pow. a method is a section of code that can be used inside your class. for example, you have a main() method. pow will need two parameters A,and B.
for example
public static void main(String args[]){
}
public static int pow(int A,int B){ //make sure to specify the return type, in this case an integer
//Code goes here
}
after making the method just use it in main. you can use a variable to hold the returned value or just print it directly to the screen.
public static void main(String args[]){
int num=pow(5,6);
System.out.println(num);
//or
System.out.println(pow(4,5)); //4^5 printed on a new line
}