Cleaned up code for some packages (#5094)

* Cleaned up code of some packages

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
Kanivets Kateryna
2024-04-02 21:26:06 +02:00
committed by GitHub
parent 40cd4d86ef
commit 22310defcd
12 changed files with 23 additions and 29 deletions

View File

@ -9,7 +9,7 @@ package com.thealgorithms.conversions;
*/
public class IntegerToRoman {
private static int[] allArabianRomanNumbers = new int[] {
private static final int[] allArabianRomanNumbers = new int[] {
1000,
900,
500,
@ -24,7 +24,7 @@ public class IntegerToRoman {
4,
1,
};
private static String[] allRomanNumbers = new String[] {
private static final String[] allRomanNumbers = new String[] {
"M",
"CM",
"D",

View File

@ -4,9 +4,7 @@ import java.util.*;
public class RomanToInteger {
private static Map<Character, Integer> map = new HashMap<Character, Integer>() {
/**
* */
private static final Map<Character, Integer> map = new HashMap<>() {
private static final long serialVersionUID = 87605733047260530L;
{

View File

@ -58,7 +58,7 @@ public class TurkishToLatinConversion {
'G',
};
for (int i = 0; i < turkishChars.length; i++) {
param = param.replaceAll(new String(new char[] {turkishChars[i]}), new String(new char[] {latinChars[i]}));
param = param.replaceAll(String.valueOf(turkishChars[i]), String.valueOf(latinChars[i]));
}
return param;
}