Java editor
Quick reference
int x = 5;declare integer variable
double d = 3.14;declare double
String s = "hello";declare String
Scanner sc = new Scanner(System.in);create scanner
sc.nextLine() / nextInt() / nextDouble()read input
System.out.println(x);print with newline
Math.pow(x,2) / Math.sqrt(x)Math methods
Integer.parseInt("42")String → int
s.length() / .substring(0,3)String methods
int[] arr = new int[5];1D array
for(int x : arr)enhanced for loop
try { } catch(Exception e) { }exception handling
Lessons:
Console output
Ready. Press Run to execute your program.
Variable inspector after run
No variables yet.