자바 DataRange 프로젝트

Jmnote (토론 | 기여)님의 2013년 2월 4일 (월) 01:40 판 (새 문서: ;자바 DataRange 프로젝트 ==DataRangeMain.java== <source lang='java'> package datarange; public class DataRangeMain { public static void main(String[] args) { byte byte_min ...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
자바 DataRange 프로젝트

1 DataRangeMain.java

package datarange;

public class DataRangeMain {
	public static void main(String[] args) {
		byte byte_min = Byte.MIN_VALUE;
		byte byte_max = Byte.MAX_VALUE;
		short short_min = Short.MIN_VALUE;
		short short_max = Short.MAX_VALUE;
		int int_min = Integer.MIN_VALUE;
		int int_max = Integer.MAX_VALUE;
		long long_min = Long.MIN_VALUE;
		long long_max = Long.MAX_VALUE;
		char char_min = Character.MIN_VALUE;
		char char_max = Character.MAX_VALUE;
		float float_min = Float.MIN_VALUE;
		float float_max = Float.MAX_VALUE;
		double double_min = Double.MIN_VALUE;
		double double_max = Double.MAX_VALUE;

		System.out.println("byte : " + byte_min + " ~ " + byte_max);
		System.out.println("short : " + short_min + " ~ " + short_max);
		System.out.println("int : " + int_min + " ~ " + int_max);
		System.out.println("long : " + long_min + " ~ " + long_max);
		System.out.println("char : " + (int)char_min + " ~ " + (int)char_max);
		System.out.println("float : " + float_min + " ~ " + float_max);
		System.out.println("double : " + double_min + " ~ " + double_max);
	}
}

2 실행결과

byte : -128 ~ 127
short : -32768 ~ 32767
int : -2147483648 ~ 2147483647
long : -9223372036854775808 ~ 9223372036854775807
char : 0 ~ 65535
float : 1.4E-45 ~ 3.4028235E38
double : 4.9E-324 ~ 1.7976931348623157E308

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}