본문 바로가기
오류리포트

[오류리포트] The method test(int) in the type Error01 is not applicable for the arguments (String)

by ssunooo 2024. 7. 4.

 

 

 

test 함수를 새로 만들어 test("안녕하세요")를 입력했더니

오류가 발생했다.

 

 

오류발생

 

 

test(); 의 input 값이 int(정수)가 아닌 String(문자열)을 입력해서

생기는 오류다.

 

1
2
3
4
5
6
7
public class Test01 {
    public static void test(double d) {
        
    }
    public static void main(String[] args) {
        
        test(3); // int 가 double에 소속되어있다.
cs

 

다시 input값을 int로 바꾸니 해결되었다.

 

 

2024.07.04