Java - Week One, Quick Reference (from 21 Days)
  21 Days:   Wk1 . Wk1Ref . Applts . Swing . Grph . D13-14 . D15-21 . D22-28
  cc12:   Miscl . SQL . EJB . Vocab . (NotesHelp) . J2EE . Web
  misl:   21 Days(src) . Dictionary(foldoc) . Unicode . Tables . Print . html
  misl:   F.Allimant . Swing (J.H.University)


  Java Data Types


===WAYS TO SPECIFY TYPE...
(1) eight primitive types, (2) name of a class (data declared is an object), (3) name of an interface, (4) or an array.

===EIGHT PRIMITIVE DATA TYPES:
Four Integer types, two Floating-Point, char and boolean.

Tbl3.1.   The 8 Primitive Data Types  (pg.64)
byte  
short  
int  
long  
float  
double  
char  
boolean  
8 bits (1 byte)  
16 bits (2 bytes)  
32 bits (4 bytes)  
64 bits (8 bytes)  
 
 
 
 
-128 ... 127
-32,768 ... 32,767
+/-  2,147 M
+/-  9,223,372,036 G
1.4E-45 ... 3.4E+38
4.9E-324 ... 1.7E+308
letters, numbers, and symbols
true or false

===CHARACTER LITERALS

Tbl3.2.   Character Escape Codes  (pg.70)
  \n
  \t
  \b
  \r
  \f
  \\
  New line
  Tab
  Backspace
  Carriage return
  Formfeed
  Backslash
  \'
  \"
  \d
  \xd
  \ud
 
  Single quotation mark
  Double quotation mark
  Octal
  Hexadecimal
  Unicode character
  (nothing for bell or vertical tab)


===OPERATOR PRECEDENCE  (pg.79, 80)

 ()  .  [] '()' used to group expresions; '.' used to access methods and variables within objects and classes (see day4); '[]' with arrays;
 ++  --  !  -  instanceof The 'instanceof' operator returns 'true' or 'false'. Determines if the object is an instance of the named class or that class's subclasses. (see day4)
 new
 (type)expression
'new' for creating new instances of classes; '()' for casting a value to another type. (see day4)
 *  /  % Multiplication, division, modulus.
 +  - Addition, subtraction.
 <<  >>  >>> Bitwise left and right shift.
 <  >  <=  >= Relational comparison tests.
 ==  != Equality.
 & AND.
 ^ XOR.
 | OR.
 && Logical AND.
 || Logical OR.
 ?  : Shorthand for, if...then...else.
 =  +=  -=  *=  /=  %=  ^= Various assignments.
 &=  |=  <<=  >>=  >>>= More assignments.

===NOTES FOUND AFTER WEEK ONE **************************************************
-----Page 315: FLOATING POINT NUMBERS
- Three examples of casting to a float constant: 0.807F, 1F, 0F
- No Java class or method we work with takes hexadecimal arguments.


********************************************************************************
B19 - Teach Yourself Java 2 in 21 Days. 2nd ed. Lemay and Cadenhead. © 2001.
********************************************************************************
Home