Show Menu
Cheatography

Java OCA 7 Reference Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Java Data Types

Data Type
Size/Bits
Default Value
byte
8
0
short
16
0
int
32
0
long
64
0
float
32
0.0
double
64
0.0
boolean
1
false
char
16
\u0000

Java Naming Conven­tions

Name Type
Descri­ption
Variable Names
Can start with a letter, $(Dollar Symbol), or '_' unders­core; cannot start with a number; cannot be a reserved word
Method Names
Verbs or verb phrases with first letter in lowercase, and the first letter of subsequent words capita­lized; cannot be reserved words. Example: setCol­or();
Class and Interface Names
Descri­ptive names that begin with a capital letter, by conven­tion; cannot be a reserved word.
Constant Names
They are in capitals