본문 바로가기

분류 전체보기

(138)
반응형
Immutable class // Location Class- adventure game 이용 개념 https://codedragon.tistory.com/m/7930 https://limkydev.tistory.com/m/68 inner code can't be changed once they are created. To avoid external modification. // for encapsulation and reducing errors. private/ final field setter X variables는 constructor에 HashMap(Key,value) 이용한 경우 Location Class package com.timbuchalka; import java.util.HashMap; import java.util.Map; public class Location { privat..
Spring split method String[] aa = "this is Sting split method".split(""); .split(" ") 괄호안에는 원하는거 암거나. package com.timbuchalka; public class Test { public static void main(String[] args) { String[] aa = "this is Sting split method".split(" ");// V for (String i : aa) { System.out.println(i); } System.out.println("================================"); String[] bb = "this is Sting, split method".split(","); // V for (St..
Map Interface - Collection - Adventure Game Challenge. 동굴탐험. locaton, direction Location Class ... Map exits = new HashMap(); Main Class Map location= new HashMap(); 그림과 같은 게임 프로그램 만들어보자. > Main을 기본으로 위치설정(위치당 값설당-Map) // Location Class의 add exits method(Map exits)로 방향 설정. 1. 값 설정 코딩 짜보자.(Location class / Main class) Location Class package com.timbuchalka; import java.util.HashMap; import java.util.Map; public class Location { private final int loca..
Map Interface - collection https://wikidocs.net/208 기본개념 > Key를 통해 value를 얻는다. Part of the collctions framework(not a true collection(->data save)) Each key는 only map to a sinlge value (-> 동일 key에 다른 value값 add하면, @overwritten됨.) > map.put(key, value) ; add ----> sout(map.put(key, vlaue)); 는 출력오류남. 미리 add하고 sout(map.get(key)); 로 써야함. map.get(key); 출력 map.containkey(key); 검색 map.remove(); 제거 ........... ex)map.remve(key); ..
Colletions List moethods / Colletions 기능들 - Theater코딩 이용 seperate refereces, same data 가능? -Collections.revers(); 역순 -Collections.shuffle(); random -Collections.min(); 최소 -Collections.max(); 최대 ..........................................min.mas기능 shuffle한 data에도 적용. -Collections.sort(); 순서대로 정렬 -Collctions.copy 예) Collections.shuffle(seatCopy); //random으로 정렬 Theatre.Seat minSeat = Collections.min(seatCopy); //min Theatre.Seat maxSeat = Collections.max(..
Comparable / Comparator - Theater 코딩 이용 https://jeong-pro.tistory.com/m/173 개념참고. Theater 코딩서 이미 좌석정렬했는데, 가격순 정렬도 보고싶다? comparable(cmopareTo)를 수정할 순 없고, 가격순 comparator 추가! Comparable : public class xxxx implement Comparable{ ....@override...CompareTo() } 이용 참고)CompareToIgnoreCase() : 대소문자 무시 Comparator : implement 이용 안함. 1. comparator type의 object 생성 -(여러개 comparator 생성가능) 2. 주로 익명 Class이용하여 compare()이용하여 initialization static final C..
IT 개발자와 일할 때 필요한 모든 개발지식] A to Z 자료 모음집 https://www.grabbing.me/IT-A-to-Z-By-1e1fbc981b7c4c03ac44943085ac8304[IT 개발자와 일할 때 필요한 모든 개발지식] A to Z 자료 모음집 By 그랩장담하건대 이 내용들만 알고 계시면 IT 개발의 전체적인 흐름은 전부 파악한다고 보셔도 무방합니다.www.notion.so - [IT 개발자와 일할 때 필요한 모든 개발지식] A to Z 자료 모음집 By 그랩 IT 개발의 전체적인 흐름 전부 파악. 네트워크, 프론트엔드, 백엔드, 유저 로그, 클라우드, 배포, git 등등등 IT 개발자가 하는 거의 대부분의 일들을 비개발자의 입장에서 정리. (대상 : 기획자, 디자이너, PM, PO, 스타트업 대표님들, 신입 개발자 등)
Collections.binarySearch(); / Theater코딩에 binarySearch 이용 sorted list(정렬된 리스트)에서 검색 빠르게 처리 하고싶을때, 쓰면 좋다.( 검색결과는 index값으로 전환됨.) comparator를 사용하며, 찾지 못하면 - 값. ex) ascending order일때 int index = Collections.binarchSearch(List, seachKey) ; or int index = Collections.binarchSearch(List, searchKey, 지정한comparator); -1. desceding order 일때 int index = Collections.binarchSearch(List, searchKey, Collections.reverseOrder); -2. List of user-defined class objects 일때 ..