Java) Wildcards
This post was migrated from Tistory. You can find the original here. Wildcards Source Unlike arrays, generics don’t support covariance/contravariance. // covariance Object[] Co...
This post was migrated from Tistory. You can find the original here. Wildcards Source Unlike arrays, generics don’t support covariance/contravariance. // covariance Object[] Co...
This post was migrated from Tistory. You can find the original here. List List<Integer> list = Arrays.asList(new Integer[] {1,2,3}); List<int[]> list2 = Arrays.asList(new int[]{1, 2,...
This post was migrated from Tistory. You can find the original here. Stream.of Stream<int[]> stream = Stream.of(new int[3]); Stream<char[]> stream1 = Stream.of(new char[3]); ...
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...