Here you can find the source of powerString(int power)
static String powerString(int power)
//package com.java2s; //License from project: Open Source License public class Main { static String powerString(int power) { if (power == 1) { return ""; }//from w w w . ja v a 2s .c o m if (power < 0) { return "^(" + power + ")"; } return "^" + power; } }