J ava Comments and Primitive datatypes
  
 Introduction

The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name, as you've already seen:

int count = 1;

Doing so tells your program that a field named "count" exists, holds numerical data, and has an initial value of "1".

Your Ad Here

 
 Java Comments:

DelimitersUse
//Used for commenting a single line
/* ————— */Used for commenting a block of code
/** —————*/Used for commenting a block of code. Used by the Javadoc tool for generating Java documentation.


 Primitive datatypes in Java:

DataType Size Default Min Value / Max Value
byte (Signed integer)8 bits0-128 / +127
short (Signed integer)16 bits0-32,768 / +32,767
int (Signed integer)32 bits0-2,147,483,648 / +2,147,483,647
long (Signed Integer)64 bits0-9, 223, 372,036,854,775,808 / +9,223,372,036, 854, 775, 807
float (floating-point)32 bits0.01.4E-45 / 3.4028235E38
double (floating-point)64 bits0.04.9E-324 / 1.7976931348623157E308
char (Unicode character)16 bits\u0000\u0000 / \uFFFF
Boolean 1 bitfalse

 Click for Next Quick Reference
PreviousNext



Your Ad Here


 About Author
Author Name           : Mr. R.Franklin Bourgia Singh
Country                    : INDIA
Working In               : Aryans Infoway (P) Ltd.
Email                        : admin@completetutorials.co.cc
Author Home Page : http://www.completetutorials.googlepages.com
 Reach me!
   My Web URL : http://www.completetutorials.googlepages.com
   If you like this article and/or code, make a small donation to my account,
Till we meet next time BYE     

  Send your feed-back and query to admin@completetutorials.co.cc
©2008 Bourgia