Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1d4be7

Browse files
committed
docs: update AnyBaseToAnyBase and GenericTree
1 parent36dc276 commitb1d4be7

File tree

3 files changed

+230
-316
lines changed

3 files changed

+230
-316
lines changed

‎Conversions/AnyBaseToAnyBase.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
*/
1616
publicclassAnyBaseToAnyBase {
1717

18-
// Smallest and largest base you want to accept as valid input
18+
/**
19+
* Smallest and largest base you want to accept as valid input
20+
*/
1921
staticfinalintMINIMUM_BASE =2;
2022
staticfinalintMAXIMUM_BASE =36;
2123

22-
// Driver
2324
publicstaticvoidmain(String[]args) {
2425
Scannerin =newScanner(System.in);
2526
Stringn;
26-
intb1 =0,b2 =0;
27+
intb1,b2;
2728
while (true) {
2829
try {
2930
System.out.print("Enter number: ");
@@ -64,7 +65,7 @@ public static boolean validForBase(String n, int base) {
6465
char[]digitsForBase =Arrays.copyOfRange(validDigits,0,base);
6566

6667
// Convert character array into set for convenience of contains() method
67-
HashSet<Character>digitsList =newHashSet();
68+
HashSet<Character>digitsList =newHashSet<>();
6869
for (inti =0;i <digitsForBase.length;i++)
6970
digitsList.add(digitsForBase[i]);
7071

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp