Length range of Java Basic Data Types

Source: Internet
Author: User

1. Code for the length range of Java Basic Data Types

/*** @ Title: DataTypeLength. java * @ Package: com. you. dao * @ Description: Java data type length * @ Author: You Haidong * @ date: 9:40:44, January 1, March 8, 2014 * @ Version V1.2.3 */package com. you. dao;/*** @ Class Name: DataTypeLength * @ Description: Java data type length * @ Author: You Haidong * @ date: march 8, 2014 9:40:44 */public class DataTypeLength {/*** @ Title: main * @ Type: DataTypeLength * @ date: March 8, 2014 9:40:44 * @ Description: * @ param args */public static void main (String [] args) {/*** minimum value of char data type */int a = Character. MIN_VALUE;/*** maximum value of the char data type */int B = Character. MAX_VALUE;/*** minimum value of the byte data type */int c = Byte. MIN_VALUE;/*** maximum byte data type */int d = Byte. MAX_VALUE;/*** minimum value of the short data type */int e = Short. MIN_VALUE;/*** maximum byte data type */int f = Short. MAX_VALUE;/*** minimum value of the int data type */int g = Integer. MIN_VALUE;/*** maximum value of int data type */int h = Integer. MAX_VALUE;/*** minimum value of the long data type */long I = Long. MIN_VALUE;/*** maximum value of long data type */long j = Long. MAX_VALUE;/*** minimum value of the float data type */float k = Float. MIN_VALUE;/*** maximum float data type */float l = Float. MAX_VALUE;/*** minimum value of the double data type */double m = Double. MIN_VALUE;/*** maximum value of the double data type */double n = Double. MAX_VALUE;/*** character data type range */System. out. println ("character data type range:" + a + "***" + B);/*** byte data type range */System. out. println ("range of byte data types:" + c + "***" + d);/*** range of short integer data types */System. out. println ("the range of short integer data types:" + e + "***" + f);/*** the range of integer data types */System. out. println ("Integer Data Type range:" + g + "***" + h);/*** range of long integer data type */System. out. println ("the range of long integer data types:" + I + "***" + j);/*** the range of single precision data types */System. out. println ("single precision data type range:" + k + "***" + l);/*** double precision data type range */System. out. println ("Double precision data type range:" + m + "***" + n );}}
2. Running result

Character data type range: 0 *** 65535 byte data type range:-128 *** 127 short Integer Data Type range: -the range of the 32768 *** 32767 Integer Data Type:-2147483648 *** the range of the 2147483647 *** 9223372036854775808 long integer data type:-9223372036854775807 *** the range of the single precision data type: 1.4E-45 **** 3.4028235E38 dual precision data type range: 4.9E-324 *** 1.7976931348623157E308


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.