You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Java 25, it's not necessary to wrap main in a class, so shortest boilerplate is:
voidmain(String[]a){}
// If the hole doesn't have arguments:voidmain(){}
The var data type
Defining a type with var is often shorter. Note that multiple assignment is not possible with this method.
Strings="foo";
// vsvars="foo";
Unicode constants
This can save 1 to 2 characters on char scoring. If you need a large integer constant between 1000 and 65535 (inclusive), it may help to use a char literal instead of a number:
varn=30000;
// vsvarn='田';
Scientific Notation
This can save a few chars when using large numbers that end in zeros
varn=30000;
// vsvarn=3e4;
Use Fields to Initialize to Zero
If you need a single integer initialized to 0, using a field saves 1 byte: