Convert from one base to another in Java
<p>Right now, I'm trying to find a way to convert a number from one base to another in Java, given a number, the base that the number is in, and the base to convert to.</p>

<pre><code>public static void BaseConversion(String number, int base1, int base2){
    //convert the number from one base to another
}
</code></pre>

<p>I found a solution for JavaScript, and I'm wondering if it would be possible to do something similar in Java:</p>

<pre><code>function convertFromBaseToBase(str, fromBase, toBase){
    var num = parseInt(str, fromBase); //convert from one base to another
    return num.toString(toBase);
}
</code></pre>
