java二进制字符串转十进制

图片中的题

public int convertToDecimal(String binary) {
    return Integer.valueOf(binary, 2);
}
温馨提示:答案为网友推荐,仅供参考
相似回答