Menu



Manage

Cord > Study_JAVA 전체 다운로드
파일 목록
Study_JAVA > 3/OneOperland.java Lines 33 | 876 바이트
다운로드

                        package week3;

public class OneOperland {
	public static void main(String[] args) {
		int iValue1 = +100;
		int iValue2 = -100;
		double dValue1 = +3.14;
		double dValue2 = -10.5;
		
		int result1 = iValue1 = +iValue1;
		int result2 = -iValue1;
		System.out.println("result1 = " + result1);
		System.out.println("result2 = " + result2);
		
		short sValue = 100;
		//short sResult = -Svalue;	//type missmatchi
		//int보다 크기가 작은 경우 부호 연산자의 결과는 int 타입이 된다
		int sResult = -sValue;
		System.out.println("sResult = "+ sResult);
		
		byte bValue = -100;
		int bResult = -bValue;
		System.out.println("bResult = " + bResult);
		
		long lValue = 100;
		long lResult = -lValue;
		System.out.println("lResult = " + lResult);
		
		double dResult = -dValue1;
		System.out.println("dResult = " + dResult);
	}
}