mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-25 05:22:39 +08:00
Remove unnecessary code (#4141)
This commit is contained in:
@ -175,7 +175,7 @@ public class AnyBaseToAnyBase {
|
||||
// If the remainder is a digit < 10, simply add it to
|
||||
// the left side of the new number.
|
||||
if (decimalValue % b2 < 10) {
|
||||
output = Integer.toString(decimalValue % b2) + output;
|
||||
output = decimalValue % b2 + output;
|
||||
} // If the remainder is >= 10, add a character with the
|
||||
// corresponding value to the new number. (A = 10, B = 11, C = 12, ...)
|
||||
else {
|
||||
|
@ -34,8 +34,7 @@ public class OctalToDecimal {
|
||||
public static int convertOctalToDecimal(String inputOctal) {
|
||||
try {
|
||||
// Actual conversion of Octal to Decimal:
|
||||
Integer outputDecimal = Integer.parseInt(inputOctal, 8);
|
||||
return outputDecimal;
|
||||
return Integer.parseInt(inputOctal, 8);
|
||||
} catch (NumberFormatException ne) {
|
||||
// Printing a warning message if the input is not a valid octal
|
||||
// number:
|
||||
|
Reference in New Issue
Block a user