Solved Pow(x,n) in java