参考一下吧~,不知道符不符合你的要求~~
public class EightTest {
public static void main(String args[])
{
int Num = 100;
//输入需要转换的10进制数
boolean isFinish = false;
String str = "";
while(!isFinish)
{
str+= Num%8;
Num =(int)(Num/8);
if(Num == 0)
{
isFinish = true;
}
}
System.out.println(new StringBuffer(str).reverse());
}
}