Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Java - Identifier and Primitive Data Types in java

                         

In this example you will learn what is identifier and primitive data types of a identifier. This tutorials will teach you how to use these identifier in you  java programming. Identifier is is a simple variable name which is defined as the value container. The type of value stored by identifier is defined by the special java keyword is termed as primitive data type.

In the given example there are some identifiers have been used like byteident, shortident, intident, longident, charident, stringident, floatident, doubleident. And there are some primitive data types of used identifiers have been also used in the program like byte, short, int, long, float, double, char and String. 

All the data type has it's own capacity to keep the maximum value. Which have been mentioned below : 

Primitive Data Types
Keyword Description Size/Format
Integers
byte Byte-length integer 8-bit two's complement
short Short integer 16-bit two's complement
int Integer 32-bit two's complement
long Long integer 64-bit two's complement
Real numbers
float Single-precision floating point 32-bit IEEE 754
double Double-precision floating point 64-bit IEEE 754
Other types
char A single character 16-bit Unicode character
boolean A boolean value (true or false) true or false
Source: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html

Code of the Program : 

public class identifierandpdatatype{
  public static void main(String[] args){
    byte byteident = 3;
    short shortident=100;
    int intident = 10;
    long longident = 40000;
    char charident = 'a';
    String stringident = "chandan";
    float floatident = 12.0045f;
    double doubleident = 2333333.000000000033343343434f;
    System.out.println(byteident + " is the value of identifire 

named 'byteident' which primitive data type is byte.");
    System.out.println(shortident + " is the value of 

identifire named 'shortident' which primitive data type is short.");
    System.out.println(intident + " is the value 

of identifire named 'intident' which primitive data type is int.");
    System.out.println(longident + " is the value 

of identifire named 'longident' which primitive data type is long.");
    System.out.println(charident + " is the value 

of identifire named 'charident' which primitive data type is char.");
    System.out.println(stringident + " is the value

 of identifire named 'stringident' which primitive data type is string.");
    System.out.println(floatident + " is the value 

of identifire named 'floatident' which primitive data type is float.");
    System.out.println(doubleident + " is the value

 of identifire named 'doubleident' which primitive data type is double.");
  }
}


Download Identifier and primitive data types Example

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

4 comments so far (
post your own) View All Comments Latest 10 Comments:

actually not able to make programs in java .basically i face prob in command line,plz help me out gv a rep as soon as possible

Posted by jaspreet on Sunday, 09.14.08 @ 18:20pm | #79350

Hi
U done good job. and I have one more doubt.....i.e:
1.What is the difference between primitive data type and Abstract data type in java?

Posted by vasu on Friday, 09.5.08 @ 13:12pm | #77236

Hello
I want to know what the benefits are of having many different data types in java and give an example of a data value that it can hold?
Thank you
Sam

Posted by Sam on Sunday, 12.9.07 @ 06:31am | #41626

u done a great job.

Posted by radhika on Wednesday, 03.21.07 @ 22:46pm | #12412

Latest Searches:
redirect
custom validator
polemophsm
struttutorial
define
clear the screen in ja
struts-servlets.xml
asp tutorial
Sort column Header on
ListSelectionEvent
ascii
input in array
abstract classes
About Eclipse SQL Expl
count row in resultset
disco ball
jspprogram
main screen with menus
Database MS Access Dat
drill down using jfree
scroll bar
jstl list size
File InputStream
Struts Projects
helloe world servlet
dialog box alignment
pdf conversion from js
Jasper Reports
birthday
reading file(java)
iterator
java code to divide wi
tree
Photoshop Basic Shapes
generate report in exc
ั?à¹???ะà¸?ะà¸?à
remove rectangle
Vector
jsp with strutsframewo
select a row in jsp
code for running appl
login authentication
logout code in jsp
insert fields blob
foreach
OutStream wrapper Clas
decimals
ะà¸?ะ???ะà¸?ยÂ
text in a webbrowser u
JTable Renderer to be
jQuery To Hide the Div
Button
form action=
encapsulation
java strings
Installing Sun JDK on
real time in java
average numbers
set session servlet
ejp
Get first day of week
notes applet
fireTableCellUpdated
netbeans jsp jdbc
FlowLayout
breakаÐ?????аÐ????а
reading excel file usi
string trim/index.php?
hash map for loop
calculator code usind
Javascript Date and Ti
jsp bank examples
java: read string arra
Photoshop Photo Effect
requestDispatcher
HOWTO: Install Ruby on
combo box my sql
check character
dojo debug
capture screen j2me
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.