This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://ercanbozkurt.blogspot.com.tr/2016/08/java-dilinde-temel-veri-tiplerinin-alt-ust-limitleri.html */ | |
public class VeriTiplerininSinirlari | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("int"); | |
System.out.println("Üst sınır: " + Integer.MAX_VALUE); | |
System.out.println("Alt sınır: " + Integer.MIN_VALUE); | |
System.out.println(); | |
System.out.println("long"); | |
System.out.println("Üst sınır: " + Long.MAX_VALUE); | |
System.out.println("Alt sınır: " + Long.MIN_VALUE); | |
System.out.println(); | |
System.out.println("short"); | |
System.out.println("Üst sınır: " + Short.MAX_VALUE); | |
System.out.println("Alt sınır: " + Short.MIN_VALUE); | |
System.out.println(); | |
System.out.println("byte"); | |
System.out.println("Üst sınır: " + Byte.MAX_VALUE); | |
System.out.println("Alt sınır: " + Byte.MIN_VALUE); | |
System.out.println(); | |
System.out.println("double"); | |
System.out.println("Üst sınır: " + Double.MAX_VALUE); | |
System.out.println("Alt sınır: " + Double.MIN_VALUE); | |
System.out.println(); | |
System.out.println("float"); | |
System.out.println("Üst sınır: " + Float.MAX_VALUE); | |
System.out.println("Alt sınır: " + Float.MIN_VALUE); | |
System.out.println(); | |
} | |
} | |
/* | |
Çıktılar: | |
int | |
Üst sınır: 2147483647 | |
Alt sınır: -2147483648 | |
long | |
Üst sınır: 9223372036854775807 | |
Alt sınır: -9223372036854775808 | |
short | |
Üst sınır: 32767 | |
Alt sınır: -32768 | |
byte | |
Üst sınır: 127 | |
Alt sınır: -128 | |
double | |
Üst sınır: 1.7976931348623157E308 | |
Alt sınır: 4.9E-324 | |
float | |
Üst sınır: 3.4028235E38 | |
Alt sınır: 1.4E-45 | |
*/ |
Hiç yorum yok:
Yorum Gönder