본문 바로가기

Java/Java with Error25

[해결 방법] no suitable constructor found for Jackson2JsonRedisSerializer(Class<CAP#1>) EnvironmentLanguage: Java17Framework: SpringBoot 3.1.0 오류constructor Jackson2JsonRedisSerializer.Jackson2JsonRedisSerializer(Class) is not applicable(argument mismatch; Class cannot be converted to Class)constructor Jackson2JsonRedisSerializer.Jackson2JsonRedisSerializer(JavaType) is not applicable(argument mismatch; Class cannot be converted to JavaType)where T is a type-variable: T extends Ob.. 2024. 11. 24.
[해결 방법] error: no suitable method found for ... 👉 기본 환경 - Language: Java - IDE: Sublime ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import java.util.Arrays; import java.util.Collections; class Solution { public String solution(String s) { String answer = ""; char[] sToCharArr = new char[s.length()]; for(int i=0; i-1; i--){ sb.append(sToCharArr[i]); } answer = sb.toString(); return answer; } } 🖨️오류 1 2 3 4 5 6 7 8 9 10 11 12 13.. 2023. 10. 17.
[해결 방법] java.lang.ClassCastException 👉 기본 환경 - Language: Java - IDE: Eclipse ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int N = Integer.parseInt(br.r.. 2023. 8. 15.
[해결 방법] Syntax error 👉 기본 환경 - Language: Java - IDE: Eclipse ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw.write(method1({"hello", "java", "world"})); bw.flush(); bw.close(); } public static String method1(String[] sentence) { StringBuffer sb = new StringBuffer(); for (Strin.. 2023. 8. 9.
[해결 방법] java.lang.Error 👉 기본 환경 - Language: Java - IDE: Eclipse ⌨️ 코드 1 2 3 4 5 int[] intArr = new int[3]; while (intArr.length-- > 0) { } 🖨️오류 java.lang.Error: Unresolved compilation problem: The final field array.length cannot be assigned 📡 원인 array의 length 값은 final 값으로 변경할 수 없음 📰 해결 방법 1 2 3 4 5 6 int[] intArr = new int[3]; int len = intArr.length; while (len-- > 0) { } 새로운 변수를 선언해서 length값을 넣고, 해당 변수의 값을 변경 2023. 8. 9.
[해결 방법] java.lang.Error ☕ 기본 환경: IDE: Eclipse, Language: Java 발생 Error Java에서 다음 Source Code를 실행할 경우, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.math.BigInteger; public class Main { public static void main(String[] args) throws Exception { B.. 2023. 6. 6.