mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-25 21:44:07 +08:00
Closing scanners.
This commit is contained in:
@ -52,6 +52,7 @@ public class AnyBaseToAnyBase {
|
||||
}
|
||||
}
|
||||
System.out.println(base2base(n, b1, b2));
|
||||
in.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,7 @@ public class AnytoAny {
|
||||
dec /= db;
|
||||
}
|
||||
System.out.println(dn);
|
||||
scn.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ class DecimalToBinary {
|
||||
n >>= 1;
|
||||
}
|
||||
System.out.println("\tBinary number: " + b);
|
||||
input.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,6 @@ public class HexToOct {
|
||||
// convert decimal to octal
|
||||
octalnum = decimal2octal(decnum);
|
||||
System.out.println("Number in octal: " + octalnum);
|
||||
|
||||
|
||||
scan.close();
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class HexaDecimalToDecimal {
|
||||
and it returns the decimal form in the variable dec_output.
|
||||
*/
|
||||
System.out.println("Number in Decimal: " + dec_output);
|
||||
|
||||
scan.close();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ public class OctalToHexadecimal {
|
||||
// Pass the decimla number to function and get converted Hex form of the number
|
||||
String hex = DecimalToHex(decimal);
|
||||
System.out.println("The Hexadecimal equivalant is: " + hex);
|
||||
input.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user