Here you can find the source of pow(final int a, final int b)
public static int pow(final int a, final int b)
//package com.java2s; public class Main { public static int pow(final int a, final int b) { if (b == 0) return 1; else if (b == 1) return a; else {/*www. j av a2 s.co m*/ int result = a; for (int i = 1; i < b; i++) result *= a; return result; } } }