overview table primitive data types name size in bits range of values boolean true or false byte char short int long float double - to + '\ to '\uffff- , to + , - , , , to + , , , - , , , , , , to + , , , , , , approximately - to + significant digits approximately - to + significant digits unlike and ++which use integers for true/false valuesboolean is distinct type in java type char is unsignedand uses two bytes to accommodate the unicode character representation schemewhich can handle international characters the int type varies in size in and ++depending on the specific computer platformin java an int is always bits literals of type float use the suffix (for example )literals of type double need no suffix literals of type long use suffix (as in )literals of the other integer types need no suffix java is more strongly typed than and ++many conversions that were automatic in those languages require an explicit cast in java all types not shown in table such as stringare classes input/output there have been changes to input/output as java has evolved for the console-mode applications we'll be using as example programs in this booksome clunky-looking but effective constructions are available for input and output they're quite different from the workhorse cout and cin approaches in +and printf(and scanf(in older versions of the java software development kit (sdkrequired the line import java io *at the beginning of the source file for all input/output routines now this line is needed only for input