<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java HowTo Guide &#187; Data Types</title>
	<atom:link href="http://www.javahowtoguide.com/category/java-basics/data-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javahowtoguide.com</link>
	<description>Learn JAVA with US</description>
	<lastBuildDate>Tue, 20 Dec 2011 10:10:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Primitive Data Types</title>
		<link>http://www.javahowtoguide.com/primitive-data-types/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=primitive-data-types</link>
		<comments>http://www.javahowtoguide.com/primitive-data-types/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 09:22:52 +0000</pubDate>
		<dc:creator>Java Tutor</dc:creator>
				<category><![CDATA[Data Types]]></category>
		<category><![CDATA[Java Basics]]></category>
		<category><![CDATA[Primitive Data Types]]></category>

		<guid isPermaLink="false">http://www.javahowtoguide.com/?p=77</guid>
		<description><![CDATA[ <p align="center"> </p> <p>The Java programming language requires you to declare all variables before using them.  You can declare the variables by specifying their names and data types.</p> <p>For example, to declare a variable called “age” of numeric data type and the initial value of 1, you the syntax is:</p> <p>int age=1;</p> <p>Java supports not only int, but seven other primitive data types, defined by the programming language itself. These data types include boolean, byte, short, int, long, float, double, and char data types. Let’s understand each of these in a little more detail:</p> Byte is an 8-bit data type that requires little storage space, with a minimum value of -128 and a maximum value of 127. It provides four times more space than an int data type. Large arrays generally use a byte data type instead of int data type. Short is a 16-bit data type that has a minimum value of -32,768 and a maximum value of 32,767. When compared to an integer, this data type is twice as small and is also used to save space in an array. The default value of the Short data type is 0. Int is a 32 bit data type having a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647. Almost all programming languages use this data type to store numbers. Just like Short, its default value is also 0. <p></p> Long is a 64-bit data type having a minimum value of 9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807. You will generally use this data type to store the numbers that don’t fit in the range provided by the int data type. Float is a 32-bit data type, used for storing floating point numbers. You can’t use a float data type to store currency. However, a float data <p>Continue reading <a href="http://www.javahowtoguide.com/primitive-data-types/">Primitive Data Types</a></p>]]></description>
			<content:encoded><![CDATA[<p align="center"><strong><br />
</strong></p>
<p>The Java programming language requires you to declare all variables before using them.  You can declare the variables by specifying their names and data types.</p>
<p>For example, to declare a variable called “age” of numeric data type and the initial value of 1, you the syntax is:</p>
<p>int age=1;</p>
<p>Java supports not only int, but seven other <strong>primitive data types, </strong>defined by the programming language itself. These data types include boolean, byte, short, int, long, float, double, and char data types. Let’s understand each of these in a little more detail:</p>
<ul>
<li><strong>Byte</strong> is an 8-bit data type that requires little storage space, with a minimum value of -128 and a maximum value of 127. It provides four times more space than an int data type. Large arrays generally use a byte data type instead of int data type.</li>
</ul>
<ul>
<li><strong>Short</strong> is a 16-bit data type that has a minimum value of -32,768 and a maximum value of 32,767. When compared to an integer, this data type is twice as small and is also used to save space in an array. The default value of the Short data type is 0.</li>
</ul>
<ul>
<li><strong>Int </strong>is a 32 bit data type having a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647. Almost all programming languages use this data type to store numbers. Just like Short, its default value is also 0.</li>
</ul>
<p><span id="more-77"></span></p>
<ul>
<li><strong>Long</strong> is a 64-bit data type having a minimum value of 9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807. You will generally use this data type to store the numbers that don’t fit in the range provided by the int data type.</li>
</ul>
<ul>
<li><strong>Float</strong> is a 32-bit data type, used for storing floating point numbers. You can’t use a float data type to store currency. However, a float data type helps to save memory in large arrays used for storing floating point numbers.</li>
</ul>
<ul>
<li><strong>Double </strong>is another 64-bit data type, generally used to store decimal values. Just like Float, this data type is also used for storing floating point numbers.</li>
</ul>
<ul>
<li><strong>Boolean data type </strong>only stores two types of values, either True or False.<strong> </strong>The default value of this data type is set to False.<strong> </strong>The data type requires only 1 bit of storage space and is generally used in simple operations that track true or false operations.</li>
</ul>
<ul>
<li><strong>Char</strong> is a 16-bit data type used to store character data. The minimum value that a char data can store is <code>u0000'</code> or 0 and the maximum value it can store is <code>ffff</code> or 65535.</li>
</ul>
<ul>
<li><strong>String, </strong>which is<strong> </strong>not a data type in the real sense, is used to store long sentences.</li>
</ul>
<ul>
<li><strong>Literals</strong> are a constant value assigned to a variable, used to store a string constant or an explicit number.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.javahowtoguide.com/primitive-data-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

