Previous Next Table of Contents

Java Language Features


Primitive data types

 Type             Size/Format
byte             8-bit two's complement
short           16-bit two's complement
int             32-bit two's complement
long            64-bit two's complement

float           32-bit IEEE 754 floating point
double          64-bit IEEE 754 floating point

char            16-bit Unicode character

Control flow statements

   Statement             Keyword
decision making    if-else, switch
loops              for, while, do-while
exceptions         try-catch-throw
miscellaneous      break, continue, label:, return

Operators

   Operators                 Examples
Arithmetic operators     +, -, *
Relational operators     ==, <=, >=, !=
Logical operators        &, |, ^
String operators         +
Assignment operators     =, +=, -=
Shift operators          >>, <<


Previous Next Table of Contents

J. Anthony Parker, MD, PhD, Tony_Parker@bih.harvard.edu