본문 바로가기
★프로그래밍★/자바오류(에러)

Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from String to int

by 한나미디어 2018. 12. 1.

4일만에 자기소개서부터 면접 준비까지, 한번에 !

 

 


....아래 포스팅도 업데이트 할 예정입니다.

 

 

 

 

 

Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from String to int

 

class Sample{

public int x;

public int y;

 

public Sample() {

System.out.println("Sample() 생성자 시작");

}

}

 

public class Test10 {

 

public static void main(String[] args) {

Sample ss = new Sample();

ss.x ="test";

ss.y = 20;

}

 

}

 

 

댓글