본문 바로가기

DevDevDev172

#14-3 / Stream 활용법 Reader ,Writer,File -> ASCII 전용 Stream -> 바이너리(이미지 , 동영상, 오디오, pdf,zip 등..) Stream은 byte단위로 변환 후 집어넣어야 함! byte[] data = ag.getBytes();  InputStream(입력) 부모 - 하위: FileInputStream , AudioInputStream, ObjectInputStream..등 자식 OutputStream(출력) 부모 - 하위: FileOutputStream..등 자식 ⚡ FileInputStream FileInputStream : io - buffer 필수대상 파일을 로드 한 후 해당 내용을 byte로 변환하여 결과 출력 (입력 X) - 걍 출력만 함available() : 파일 용량 (byt.. 2024. 5. 21.
Git Cmd등록 :git config --global user.name ""git config --global user.email ""확인 : git config user.name git config user.email   Git 프로그램 설치  Github 로그인 => git 사용 이름,git 사용 이메일 정보 겟 =>토큰 제작(패스워드) - admin:ssh_signing_key 빼고 체크=> Git repository( ? 자료를 공유할 수 있는 공간)에 참여,혹은 만들기 => 아이디,패스워드 등록 => repository 생성  STSshow view create new local .. - 경로(src)remotes 우클릭 - create remote - uri , 비밀번호 등록 -> save and .. 2024. 5. 21.
#14-2 / nio ⚡ Files(nio 형태) 이용한 파일 내용을 배열에 저장 File : io  / Files : nio(Buffer 장착)   => (https://dev-eunse.tistory.com/3) 참고io,nio 둘중 하나만 사용 ! - 알아서 선택Files : new 작성할필요 x - 어차피 메모리에 저장되기때문에- nio 방식 public static void main(String[] args) { String url = "D:\\webpage\\agree\\src\\main\\java\\io\\agree.txt"; try { //List interface 구성 형태로 nio 배열 저장 List data = new ArrayList(); //List로만 사용 가능 .. 2024. 5. 21.
byte단위 배열 데이터 출력 ⚡ byte를 이용한 배열형태 -> 문자열로 변환String word = "abc";byte data2[] = word.getBytes(); //ASCII 코드로 배열에 저장System.out.println(Arrays.toString(data2)); //[97, 98, 99] 출력String unbox = new String(data2); //언박싱System.out.println(unbox); //abc 출력 2024. 5. 21.
#14-1 / FileReader => Buffer Buffer : 메모리를 활용하여 데이터를 출력 또는 입력(temp : 임시저장소)buffer는 기억하는애FileReader fr = new FileReader(url);System.out.println((char)fr.read());//파일을 읽을때 해당 방식은 텍스트 파일의 한글자만 출력됨..▶  이걸 개선한게 Buffer ⚡ BufferFileReader fr = new FileReader(url);BufferedReaderbr = new BufferedReader(fr); ( 이걸 맞춰주면 에러날일 X  , buffer가 먼저 나올 순 없음)👀주의- reader(or write) 선언 후 buffer 선언- Buffer는 임시 저장된 공간의 데이터이므로 read 또는 readLine() 사용시 .. 2024. 5. 21.
12. io와 nio의 차이점 https://dev-coco.tistory.com/42https://velog.io/@jihoson94/BIO-vs-NIOhttps://blog.naver.com/rain483/220636709530 👀 io블로킹 방식Blocking API란 API를 호출한 Thread가 API의 작업이 끝날 때까지 다른 동작을 하지않는 API를 블록킹이라고 합니다.하나의 thread가 read() or write()를 발생시킬때, 해당 thread는 데이터를 읽을 때까지 혹은 데이터를 적을때까지 blocked. 막혀있습니다.Blocking API들은 반환값을 받을 때까지(작업이 끝날 때) Blocking 되기 때문에 해당 Thread는 idle상태로 유지되게 됩니다. -IO 스레드가 블로킹되면 다른 일을 할 수 없.. 2024. 5. 21.
#13-4 / I/O 🔥 👀 선생님 전체 정리 내용https://dev-eunse.tistory.com/99 👀 내가 해본 전체 정리 내용https://dev-eunse.tistory.com/92 I/O : input/output input - 키보드,마우스,Hdd,File ..등output - 모니터,프린터.. 등 java.io > java.nio 👀I/O는 무조건 예외처리를 사용해야한다  - 넣지 않으면 작동불능!load할 파일명과 경로가 올바른 상황이면 try/그 반대 상황은 catch 🔽 파일 첨부 기능 제작시 주로 사용public static void main(String[] args) { try {//io는 예외처리 필수 //해당 로드할 파일 properties -> 경로 입력 //서버에 올라가있으.. 2024. 5. 20.
#13-3 / Map클래스배열(Key배열) ArrayList,LinkedList는 key배열 아님Map => key : 데이터값, valueMap-가장 큰단위 , 그 안에 자식 Hashmap,Hashtable,TreeMap (List와 같다고 생각하면 됨)Interface임 ( ArrayList,LinkedList  얘네는 class) - List처럼 엄마만 Interface,하위는 class 👀{product=모니터} 이런 형식으로 출력됨int사용 불가 - Integer사용 (List와 동일)중복된 key 사용 불가 Hashmap -> ArrayList -> LinkdedList 로 변환해서 프론트에게 전달! (실무에선 이렇게 사용함) 👀Hashtable : 데이터 병렬처리 및 ThreadHashMap : 단일 처리 및 Single Thre.. 2024. 5. 20.
변수 + 반복문 String aa0 = "a";String aa1 = "b";String aa2 = "c";Object adata[] = {aa0,aa1,aa2};int w=0;while(w  Object 배열을 이용하여 여러개의 배열을 순차적으로 적용하기 위한 방법Integer data1[] = {10,20,30,40,50,60,70,80,90};Integer data2[] = {5,10,15,20,25,30,35,40,45};Integer data3[] = {7,14,21,28,35,42,49,56,63};Object data_all[] = {data1,data2,data3};Integer list[] = (Integer[])data_all[0];int w=0;while(w 2024. 5. 20.
#13-2 / Thread ✅ 웹개발자는 스레드 다룰 일이 크게 없다-> web 개발자가 유일하게 스레드를 활용 하는 경우 : API Server    Javascript에서 멀티 스레드(많이 써봣자 4개) : web worker을 쓰게 되면 멀티 스레드를 사용하게됨⚡ 단일스레드(기존 알던방식)단일스레드 : 순차적으로 실행되기 때문에 위에서 에러나면 아래도 실행안됨public static void main(String[] args) { th1_box th = new th1_box(); th.aaa(); th.bbb(); //대기 int w=0; do { th1_box thb = new th1_box(); thb.ccc(w); //애두 단일스레드 w++; }wh.. 2024. 5. 20.
#13-1 / String, StringBuilder, StringBuffer ⚡  new String()같은 자료형 또는 자료형 클래스라고 할지라도 new가 붙었다면 인스턴스 영역(메모리)으로 변경되므로 비교하는 상황이 달라질 수 있다String a = "a1234";String b = "a1234";String c = new String("a1234"); //new : 인스턴스 생성 == RAM에 올라갔단 뜻String d = new String("a1234");System.out.println(a==b); //trueSystem.out.println(a.equals(b)); //trueSystem.out.println(a==c); //falseSystem.out.println(a.equals(c)); //trueSystem.out.println(c==d); //false ⚡ .. 2024. 5. 20.
05.17 memo ⚡ 자동실행 메소드 + 재귀함수는 x  class sese{public sese() { LinkedList ss = this.add_ex15(); this.sarr2.add(ss); System.out.println(this.sarr2); new sese(); // new를 넣어주면 reset되기 때문에 재귀가 의미가 없다}}🔽class exam15t_box { public void abc() { //머시기 abc(); //이게 맞음 (즉시실행함수 아님) } }https://dev-eunse.tistory.com/73 ⚡ 예외처리package exam;import java.util.ArrayList;import java.util.Arrays;/*6. {"1000","20.. 2024. 5. 17.
#12 / remind2 /* 1. {1,3,6,9,10}의 원시배열 데이터 중 홀수 값을 다음과 같이 모두 변경합니다. (LinkedList 사용) 결과 : {2,4,6,10,10} 으로 변경 LinkedList는 set이 더 빠름 */ public class exam12 { public static void main(String[] args) { Integer arr[] = {1,3,6,9,10}; List arr_l = new LinkedList(Arrays.asList(arr)); int idx=0; for(Integer a : arr_l) { //forEeach if(a%2 == 1) { arr_l.set(idx,a+1); }else { arr_l.set(idx,a); } idx++.. 2024. 5. 17.
#11-2 / 배열을 이용한 예외처리 ⚡ 배열을 이용한 예외처리package oop2;import java.util.ArrayList;import java.util.Arrays;//배열을 이용한 예외처리public class ex10 { public static void main(String[] args) { //object형태의 자료형 전체를 확인 //System.out.println(data[4].getClass().getName()); //간단한 자료형 이름만 출력 //System.out.println(data[4].getClass().getSimpleName()); Object data[] = {"유재석",1000,"실버회원",0.5,true}; ArrayList user = new ArrayList(); //빈.. 2024. 5. 16.
#11-2 / 외부클래스 + 예외처리 ⚡ 메소드 형태의 오류처리 선언 및 호출 방법throws : 해당 메소를 실행시 예외처리 구분자를 필수로 적용시키는 형태메소드에서 throws 실행시 반드시 try,catch로 받아야함(협업할때 주로 사용)package oop2;//메소드 형태의 오류처리 선언 및 호출 방법public class ex5 { public static void main(String[] args) { ex5_box ex5 = new ex5_box(); try { //try{try{}}는 x //해당 메소드에서 throws이므로 무조건 try~catch 이용 ex5.abc(5000, "500a"); }catch(Exception e) { System.out.println(e); try { //재try로 .. 2024. 5. 16.
#11-1 / Exception : 예외처리 🌺 Exception : 예외처리(오작동 발생)  - 종류 엄청많음  1. 사용자의 입력실수로 인해 정보전달이 안될 경우  2. 개발자가 프로그램 오류시 정확한 오류 파악을 하기 위한 수단  3. 강제 프로세서에 대한 정보 수정 및 종료 try{}catch(Exception 변수){}finally {} ex) 회원가입시 예외처리 사항 1. id에 한글 입력  2. 이메일 관련  3. 연락처 관련  4. 동의 및 미동의(체크박스) 관련 - 미체크시 null값 날라오면 error  5. 첨부파일 - 용량,파일속성,여러개 서버로 전송시  6. FTP 및 메일👀내가 해보니까~예외처리 : if else와 비슷한데 좀더 포괄적인 느낌..?  오류나냐 안나냐로만 나눠서 출력!try( 명령 ) 에서 오류난것들은 싹.. 2024. 5. 16.
시험1 1. 1차,2차배열 console.log 결과값2. 팝업창(부모창,자식창 데이터)3. 이벤트 핸들링4. node로 배열값을 출력5. 랜덤함수를 이용해서 결과값을 출력 --test2 @ 메일선택 네이버 네이트 구글 한메일 직접입력    --test3 자신이 좋아하는 과일 2가지 이상 선택 하세요? 사과 딸기 바나나 키위 파인애플 수박 2024. 5. 14.
#8 / Js-Node,forEach ⚡ Node로 생성 Dom객체와 Node객체 차이 angular,react,vue 등에서 node가 쓰여서 node를 많이쓰는 추세!createElement : html태그를 생성하는 함수 - 반복문 - node로 생성  ⚡ Node 추가,삭제,중간삽입append, prepend, before, after, insertBefore, remove, removeChild 강감찬 이순신  ⚡ split을 이용하여 node로 상품 출력하기 모니터 -->   ⚡ 응용문제 공지사항 게시물1 -->  ⚡ forEach 2024. 5. 14.
#10-2 / 단어 검토 및 변경(정규식 코드) ⚡ 정규식 코드//--split : 문자열을 원시배열화 함String word = "1,2,3,4,5,6,7";String arr[] = word.split(",");System.out.println(Arrays.toString(arr));//--replace : 문자변경("찾을단어","변경단어")String address = "서울특별시 마포구 마포동";String result1 = address.replace("서울특별","서울");String result2 = address.replace("마포","mapo");System.out.println(result2);//--replaceAll(정규식) : 배열 형태의 단어범위를 설정하며,특정단어로 모두 변경String code = "010abcd12z4B.. 2024. 5. 14.
object 배열 ⚡ object 형태의 class 배열 사용(1차->2차)String m[] = {"test"};int n[] = {50000};ArrayList ob = new ArrayList();ob.add(m[0]);ob.add(n[0]);System.out.println(ob); //[test, 50000]ArrayList> oball = new ArrayList>();oball.add(ob);System.out.println(oball); //[[test, 50000]] ⚡ object 배열값에 대한 자료형 확인 및 class배열에 String변환 후 담기해당배열[idx].getClass().getName()Object원시배열 -> 숫자클래스 배열로 입력할 경우 자료형 변환 후 addObject data[] .. 2024. 5. 14.