Cheatography
https://cheatography.com
Java Fundamental Cheat Sheet: A concise reference guide outlining key concepts, syntax, and best practices for Java programming beginners and enthusiasts.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
To run Java Program using Bat Script
@echo off
javac *.java
java filename
del *.class
|
Datatype Declaration and Initialization
|
Float declaration and initialization |
long l = 8_000_000_000L;
|
Long declaration and initialization |
|
Variable type inference |
Arrays
datatype[] variable = new datatype[20];
variable.length;
Arrays.sort(variable);
Arrays.sort(variable,fromIndex,endIndex);
Arrays.binarySearch(variable,intKey);
Arrays.binarySearch(variable,fromIndex,toIndex,intKey);
Arrays.toString(variable)
Arrays.equals(variable1,variable2);
|
|
|
Arrays
datatype[] variable = new datatype[20];
variable.length;
Arrays.sort(variable);
Arrays.sort(variable, fromIndex, endIndex);
Arrays.binarySearch(variable, intKey);
Arrays.binarySearch(variable, fromIndex, toIndex, intKey);
Arrays.toString(variable);
Arrays.equals(variable1, variable2);
|
Big Decimal
BigDecimal variable = new BigDecimal("Value");
variable3 = variable1.add(variable2);
variable3 = variable1.multiply(variable2);
variable3 = variable1.subtract(variable2);
variable3 = variable1.divide(variable2);
variable3 = variable1.max(variable2);
variable3 = variable1.min(variable2);
|
|