Text Size
Thursday, October 22, 2020

Content

Java Primitive Data Types

Type Bits Values Standard
boolean Machine
Dependent
true or false
char 16 0 to 65535 ISO Unicode character set
byte 8 -128 to +127
short 16 -32 768 to +32 767
int 32 -231 to +231-1
long 64 -263 to +263-1
float 32 IEEE 754 floating point
double 64 IEEE 754 floating point

Important Non-primative Types

Note: Non-primative types do not use or follow the Java Operators below.

Type Values
String Any char

Java Operators

Operators Function Associativity Type
() Anything in () happens first like in math left to right parentheses
++ -- 1 is added or subtracted to the variable after the opperation is complete right to left unary postfix
++ -- + - (type)

++ -- as above except it happens before operation

right to left unary
* / %

* multiply
/ divide
% modulus (returns the remainder)

left to right multiplicative
+ -

+ addition
- subtraction

left to right additive
= < less than
<= less than or equal to
> greater than
>= greater than or equal to
left to right relational
= = != = = equality
!= not equality
! not
left to right equality
?: right to left conditional
= += -= *= /= %= = assigned to equal right to left assignment

Leave your comments

0
terms and condition.
  • No comments found
Parent Category: ICS3U