Subsections
- Java has built-in "primitive" data types.
- These primitives support integer, floating-point, boolean, and character values.
- The primitive data types of Java are:
boolean |
either true or false |
char |
16-bit Unicode 1.1 character |
byte |
8-bit integer (signed) |
short |
16-bit integer (signed) |
int |
32-bit integer (signed) |
long |
64-bit integer (signed) |
float |
32-bit floating-point |
double |
64-bit floating-point |
- A literal is a vlue that can be assigned to a primitive or string variable, or passed as an argument to a method call.
- true
- false
- boolean isTrue = true;
- 'n' - newline
- 'r' - return
- 't' - tab
- Expresses a floating-point numerical value.
- 3.1438 - a decimal point
- 4.33E+11 - E or e; scientific notation
- 1.282F - F or f; 32-bit float
- 1355D - D or d; 64-bit double
- A sequence of text enclosed in double quotes.
- String fourScore = "Four score and seven years ago";
abstract |
default |
if |
private |
throw |
boolean |
do |
implements |
protected |
throws |
break |
double |
import |
public |
transient |
byte |
else |
instanceof |
return |
try |
case |
extends |
int |
short |
void |
catch |
final |
interface |
static |
volatile |
char |
finally |
long |
super |
while |
class |
float |
native |
switch |
|
const |
for |
new |
synchronized |
|
continue |
goto |
package |
this |
|
Fibonnaci program
|
|