전체 글
-
자바 TMI_1프로그래밍/Java 2023. 10. 11. 15:46
영어권은 문자를 1바이트로 표현이 가능 그러나 비영어권은 2바이트로 표현한다 자바는 char가 2바이트라 비영어권 문자도 깨지지않고 다 저장가능 c언어는 1바이트라서 한글같은 문자를 직접적으로 표현할 수 없고 배열을 쓰는 등의 방법을 통해 표현해야함 메모리공간의 이름을 심볼이라 하는데 그걸 프로그래밍적으로 변수라고 한다 bytecode 는 중간어 코드 자바는 컴파일하면 class 파일로 만들어준다. 어떤 OS에서 실행할지 모르기 때문에 확실하게 exe코드로 만들지 못하고 어중간하게 만들어둔 것 이것을 JVM에게 맡기는 형태이다. JVM이 1차 컴파일된 bytecode (.class)를 자신의 OS에 맞게 다시 컴파일 (.exe) 하여 메모리에 로딩하여 실행하기 때문에 자바는 OS에 독립적으로 실행이 가능..
-
9/21 TIL [프로그래머스 코딩테스트] 4문제프로그래밍/코딩테스트연습 2023. 9. 21. 16:25
가위 바위 보 반복문과 SWITCH문을 사용 class Solution { public String solution(String rsp) { String answer = ""; String b=rsp; int a=rsp.length(); for(int i=0; i s.equals("2") ? "0" : s.equals("0") ? "5" : "2").collect(Collectors.joining()); } } 진짜로 스트림 못쓰게 해야함ㅋㅋㅋㅋ 문자열 뒤집기 for문과 charAt을 사용해서 하나씩 뽑아서 answer에 넣으면 되겠다고 생각 class Solution { public String solution(String my_string) { String answer = ""; int a=my_st..