class SignExample1 {
public static void main(String args[]) {
short num1 = 100;
short num2 = - num1;
System.out.println(num2);
}
}
====================================
에러 나는데요
에러 내용
short 타입 데이터가 있어야 할 위치에서 int 타입 데이터가 발견 되었다고 합니다.
cast 연산자 를 사용하면 된다는데. 어디다가 집어 넣어야 하죠?
좀 고쳐 주세요...ㅠㅠ
==========
결과는 어떻게 되나요?
자바 프로그래밍 오류...
으악새(221.157)
2011-09-22 12:42
추천 0
댓글 9
다른 게시글
-
제 컴퓨터좀 살려주세요. ㅠㅠ티몽몽(61.97) | 11.09.22추천 0
-
엑세스 문제좀알려주세요 ㅜㅜ [1]알려줘영..(211.107) | 11.09.21추천 0
-
sas 프로그램 잘 아는 형들 도움좀...(설치문제)ㅇㅁㄹ(14.60) | 11.09.21추천 0
-
컴퓨터공학과 가려는 학생인데요 .. 면접질문좀 답해주세요 ㅠㅠ [1]면접앞둔학..(61.108) | 11.09.21추천 0
-
엑셀 좀 알려줘 ㅠㅠㅠㅠㅠㅠ익명(122.40) | 11.09.21추천 0
-
형님들 vm웨어 인터넷연결 헬프점요vm웨어헬프..(119.204) | 11.09.21추천 0
-
횽들아 나좀알려줘!!!!!!횽들아(175.253) | 11.09.21추천 0
-
플로차트 만들주 아는사람? [1]11^^(183.99) | 11.09.21추천 0
-
근데 자짤 어디감??warota(221.150) | 11.09.20추천 0
-
캐드할줄아는형있삼?? [5]호이포이(1.252) | 11.09.20추천 0
public class test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub short num1 = 100; short num2 = (short) - num1; System.out.println(num2); }}
보기가 힘드네
한줄씩 갑니다
public class test {
public static void main(String[] args) {
short num1 = 100
short num2 = (short) - num1;
System.out.println(num2);
}