for (int charIndex = 0; charIndex < octStrLen; charIndex++) {
char hexChar = octString.charAt(charIndex);
int expFactor =(int)Math.pow(8,octStrLen -1 - charIndex);
if (hexChar >= '0' && hexChar <= '7'){
dec = (hexChar * expFactor) +dec;
答案 0 :(得分:-1)
您可以使用Integer.parseInt(octStr, 8)