Java) enum
This post was migrated from Tistory. You can find the original here. enum public class Test { enum Direction { EAST("East", 10), WEST("West", -10), SOUTH("South", -20...
This post was migrated from Tistory. You can find the original here. enum public class Test { enum Direction { EAST("East", 10), WEST("West", -10), SOUTH("South", -20...
This post was migrated from Tistory. You can find the original here. Stream Stream.of/Arrays.stream int[] a = {1,2,3}; int[] b = {4,5}; String a = "hi my name is"; ...
This post was migrated from Tistory. You can find the original here. Lambda Expressions Method References //A lambda expression that calls a constructor can also be converted into a method refe...
This post was migrated from Tistory. You can find the original here. Lambda expressions @FunctionalInterface interface MyFunction { void run(); // public abstract void run(); } class Main ...
This post was migrated from Tistory. You can find the original here. Generics Wildcards ArrayList<? extends Product> list = new ArrayList<Tv>(); ArrayList<? extends Product> l...
This post was migrated from Tistory. You can find the original here. Regular expressions (regex) public class Main { public static void main(String[] args) { String t = "^[0-9]*$"; ...
This post was migrated from Tistory. You can find the original here. pwd public class Main { public static void main(String[] args) { String currentPath = Paths.get("").toAbsolutePat...
This post was migrated from Tistory. You can find the original here. List ArrayList(Vector) When you remove an element, every element below it gets copied up one slot to overwrite the remo...
This post was migrated from Tistory. You can find the original here. java.lang package Object The Object class is the ultimate ancestor of every class. By default, Object.equals() compares inst...
This post was migrated from Tistory. You can find the original here. static import import static java.lang.System.out; import static java.lang.Math.*; out.println(random()); A regular import ...