public class bb
{
public static void main(String args[])
{
System.out.println(getpower(2,10));
}
public static int getpower(int x,int y)//此为您要的递归方法
{
if(y==0)
return 1;
else if(y==1)
return x;
else return x*getpower(x,y-1);
}
}
public static void main(String args[])
{
System.out.println(getpower(2,10));
}
public static int getpower(int x,int y){
if(y==1)
return x;
else
return x*getpower(x,--y);
}