Show Menu
Cheatography

Java Cheat Sheet (DRAFT) by

Cheet sheet for java

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

Primitive Datatypes

byte / short / int / long
float / double
char
boolean
true, false
 

Strings

Create string using String literal
String s1 = "­Hello World";
Create string using new keyword and constr­uctor
String s2 = new String­("Hello World");
 

Arrays

Arrays can be used with?
primitive data types: int, char, boolean, double, float
Size of arrays
Size of arrays are given while declaring, and cannot be changed