자바) List
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. List List<Integer> list = Arrays.asList(new Integer[] {1,2,3}); List<int[]> list2 = Arrays.asList(new int[]{1, 2, 3}); Stream.of랑 비슷...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. List List<Integer> list = Arrays.asList(new Integer[] {1,2,3}); List<int[]> list2 = Arrays.asList(new int[]{1, 2, 3}); Stream.of랑 비슷...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. Stream.of Stream<int[]> stream = Stream.of(new int[3]); Stream<char[]> stream1 = Stream.of(new char[3]); public static<...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. enum public class Test { enum Direction { EAST("East", 10), WEST("West", -10), SOUTH("South", -20), NORTH("Nor...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. Stream Stream.of/Arrays.stream int[] a = {1,2,3}; int[] b = {4,5}; String a = "hi my name is"; String[] b = a.s...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. 람다식 메서드 참조 //생성자를 호출하는 람다식도 메서드 참조로 변환할 수 있다. Supplier<MyClass> s = () -> new MyClass(); Supplier<MyClass> s = MyClass::new; //배...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. 람다식 @FunctionalInterface interface MyFunction { void run(); // public abstract void run(); } class Main { static void execute(MyFunction...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. Generics 와일드 카드 ArrayList<? extends Product> list = new ArrayList<Tv>(); ArrayList<? extends Product> list = new ArrayList<A...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. 정규표현식(regex) public class Main { public static void main(String[] args) { String t = "^[0-9]*$"; String res = "1597asd123".rep...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. pwd public class Main { public static void main(String[] args) { String currentPath = Paths.get("").toAbsolutePath().toString(); ...
이 글은 Tistory에서 이전된 포스팅입니다. 원본은 여기에서 확인할 수 있습니다. List ArrayList(Vector) 요소를 삭제할 경우 삭제할 객체의 바로 아래에 있는 데이터를 한 칸씩 위로 복사해서 삭제할 객체를 덮어씐다. 마지막 데이터는 null로 변경한다. 그래서 맨 위의 데이터를 수정/삭제하는데 느리다. 추가도 이...