Skip to content

Instantly share code, notes, and snippets.

@xetys
xetys / Hard.java
Created October 9, 2018 21:01
Add Without Plus
public class Hard {
public static void main(String[] args) {
for(int i = 0; i < 100; i++) {
for(int j = 0; j < 100; j++) {
assert addWithoutPlus(i,j) == i + j;
}
}
@xetys
xetys / javaswitch.sh
Created March 2, 2022 09:13
Java Version Switcher
#!/usr/bin/env bash
declare -A JDKS
JDKS[8]="/usr/lib/jvm/jdk1.8.0_251"
JDKS[11]="/usr/lib/jvm/jdk-11.0.9"
JDKS[14]="/usr/lib/jvm/jdk-14.0.1"
JDKS[16]="/usr/lib/jvm/jdk-16.0.2"
if [ "$#" -ne 1 ]; then