Back to Top

Saturday, 11 January 2014

JAVA: Data Types Conversion Chart

      In Java Programming Language, we must declare a variable name and type, before using it. The data type of a variable defines the the type of value it will contain. Java supports total 8 types of primitive data types. The name of this data types are all reserved as keywords.
Among which, 1) byte, 2) short, 3) int & 4) long can store integer values of different range.
5) float and 6) double can store floating numbers of different range.
7) boolean  can store only true/false. It is used as flag, to perform boolean operation.
8) char can store a single 16-bit Unicode character of range from '\u0000' (0) to '\uffff' (65,535).
Apart from these, Java also provides a String data type which is defined as a Class (java.lang.String). It can contains alpha numeric values.


  • Type: Integer (8-bit signed two's complement integer).
  • Range:  from -128 [-2^(8-1)] to 127 [(2^(8-1))-1].
  • Memory: 1 byte
  • Default Value : 0
  • Example: byte b = 0;


  • Type: Integer (16-bit signed two's complement integer).
  • Range:  from -32768 [-2^(16-1)] to 32767 [(2^(16-1))-1].
  • Memory: 2 bytes
  • Default Value : 0
  • Example: short s  = 0;

  • Type: Integer (32-bit signed two's complement integer).
  • Range:  from -2147483648 [-2^(32-1)] to 2147483647 [(2^(32-1))-1].
  • Memory: 4 bytes
  • Default Value : 0
  • Example: int i = 0;


  • Type: Integer (64-bit signed two's complement integer).
  • Range:  from -9223372036854775808 [-2^(64-1)] to 9223372036854775807 [(2^(64-1))-1].
  • Memory: 8 bytes
  • Default Value : 0L
  • Example: long l = 0L;


  • Type: Float (Single precision 32-bit IEEE 754 floating point).
  • Range:  from 1.4E-45F to 3.4028235E+38F.
  • Memory: 4 bytes
  • Default Value : 0.0f
  • Example: float f = 0f;


  • Type: Float (Single precision 64-bit IEEE 754 floating point).
  • Range:  from 4.9E-324D to 1.7976931348623157E+308D.
  • Memory: 8 bytes
  • Default Value : 0.0d
  • Example: double d = 0d;


  • Type: boolean (boolean flag - true / false).
  • Range:  NA.
  • Memory: virtual machine dependent
  • Default Value : false
  • Example: boolean b = false;


  • Type: Character (a single 16-bit Unicode character).
  • Range:  from '\u0000' (0) to '\uffff' (65535).
  • Memory: 2 bytes
  • Default Value : '\u0000'
  • Example: char c = '\u0000';


  • Type: String Character (a class can store alpha numeric value).
  • Range:  NA
  • Memory: NA
  • Default Value : null
  • Example: String s = "Hello World";

Anijit Sarkar

19 Responses to “ JAVA: Data Types Conversion Chart ”

Hardcoded said...
15 January 2014 at 20:05

You shouldn't use Boolean/Byte/Short/Integer/Long.valueOf(String) to get a (native) boolean/byte/... It's like calling:
byte b = Byte.valueOf(Byte.parseBoolean(string));

Hardcoded said...
16 January 2014 at 14:51

The byte to String conversion doesn't convert the byte value to a String representation, it treats the byte as a character of the plattforms default charset. So this is most likely the wrong method to convert a byte to String

asitbangalorereviews said...
19 August 2015 at 18:11

Very useful...

Mac Haik said...
2 October 2016 at 16:15

Thanks and Impressive Article. Outsourcing Data Conversion requirements of many a business has proven to be vital and wise decision. It helps them to function effectively and save a considerable amount of time and money. IT Outsourcing Services offer to convert your data into a powerful management resource. However difficult, complex or voluminous be your data conversion project, we will get it completed quickly and cost effectively. With the support of experienced team of Data Conversion professionals and state-of-the-art technology, we can obtain data from virtually any media source or file and convert it into usable formats. Our experience and capability to provide the complete Data Conversion solutions make us leaders in the industry.

Naviya Nair said...
24 October 2016 at 14:58

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

Java Training Institutes in Chennai Java Training in Chennai

shasthika said...
23 March 2017 at 12:37

perfect explanation about java programming .its very useful.thanks for your valuable training in chennai | chennai's no.1 java training in chennai

Geetha Devi said...
25 March 2017 at 11:51

Very informative ..i suggest this blog to my friends..Thank you for sharingjava training in chennai | chennai's no.1 java training in chennai

shasthika said...
25 March 2017 at 13:04

perfect explanation about java programming .its very useful.thanks for your valuable training in chennai | java training in velachery

vignesjoseph said...
8 June 2017 at 16:26

Identifiers are the names of variables, methods, classes, packages and interfaces. Unlike literals they are not the things themselves, just ways of referring to them.
Software Testing Training in Chennai
Software Testing Training Institute in Chennai

Aswin Karthick said...
8 November 2017 at 15:56

thank you seo training in chennai
hibernate training in chennai
spring training in chennai

nivedhitha reddy said...
22 December 2017 at 16:58

Thanks for information Hadoop developer training

Unknown said...
22 January 2018 at 15:40

• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingAzure Online course hyderabad

CIIT Noida said...
21 April 2018 at 13:14

CIITN is the Best Php training institute in Noida and delhi Ncr. You will get Live Project Training on PHP by our PHP expert who have 5+ year industrial experience.Focus on practical and live project training. In our PHP training, we you will learn core PHP, advance PHP, HTML, CSS, JavaScript, jQuery, Bootstrap, Cake PHP and Wordpress.CIITN provides 100% job assistance in PHP training. CIITN is well known PHP coaching center because our 100% PHP students are placed now.

Ciitnoida provides Core and java training institute in noida. We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-oriented, class-based build of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an all-time high not just in India but foreign countries too.

By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13 years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best Java training in Noida.

java training institute in noida
php training in noida
linux training in noida
linux institute in noida
java course in noida

preeti verma said...
19 June 2018 at 10:33


Aman CSE said...
22 July 2018 at 00:22

very valuable knowledge.Very nice blogs!!!i hope to really understand to your information.Best AWS Training in Chennai

suresh H said...
9 August 2018 at 13:18

This is very useful Blog for Fresher who are enter into the Java world. Thanks for sharing... Core Java Training in Chennai

Rohil singh said...
29 September 2018 at 16:38

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
Good discussion. Thank you.
Six Sigma Training in Abu Dhabi
Six Sigma Training in Dammam
Six Sigma Training in Riyadh

kavinilavu G said...
20 October 2018 at 12:40

Nice was very informative.Thanks for sharing..keep update Selenium Testing Coursesoftware testing course in velachery chennai

Sparrow Jack said...
8 November 2018 at 15:05

Very useful information that you have shared and it is very useful to me. Thanks for sharing the information with us.
kindle mobi conversions

Post a Comment

Popular Posts

All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar
blog links Web Directory Academics Blogs