2025/04/26 6

[프로그래머스 / Java] Lv.1 약수의 합

Question https://school.programmers.co.kr/learn/courses/30/lessons/12928 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krCode💡내 풀이class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i 💡참고하면 좋은 풀이class SumDivisor { public int sumDivisor(int num) { int answer = 0; for(int i = 1 ; i

Coding Test/Java 2025.04.26

[프로그래머스 / Java] Lv.0 문자 반복 출력하기

Question https://school.programmers.co.kr/learn/courses/30/lessons/120825 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krCodeclass Solution { public String solution(String my_string, int n) { String answer = ""; String[] str = my_string.split(""); for(int i = 0; i split(String regex) regex : 문자열을 분할할 기준이 되는 정규 표현식입니다.rep..

Coding Test/Java 2025.04.26

[프로그래머스 / Java] Lv.0 아이스 아메리카노

Question https://school.programmers.co.kr/learn/courses/30/lessons/120819 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krCode💡내 풀이class Solution { public int[] solution(int money) { int[] answer = new int[2]; answer[0] = money / 5500; answer[1] = money % 5500; return answer; }} 💡참고하면 좋은 풀이class Solution { ..

Coding Test/Java 2025.04.26

[프로그래머스 / Java] Lv.0 특정 문자 제거하기

Question https://school.programmers.co.kr/learn/courses/30/lessons/120826 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krCodeclass Solution { public String solution(String my_string, String letter) { String answer = ""; answer = my_string.replace(letter,""); return answer; }} 💡문자열 치환 함수replace(CharSequence old, CharS..

Coding Test/Java 2025.04.26

[Java] GC(Garbage Collection)

GC(Garbage Collection)💡GC(Garbage Collection)이란?객체를 가리키는 참조값(주소)가 null인 경우, 해당 객체의 메모리에 접근할 수 없게되므로 이 객체를 찾을 수 없게된다. 이와 같은 경우에 Java의 JVM이 GC를 통해 자동으로 메모리를 제거한다.GC는 어떤 메모리 부분이 더 이상 사용되지 않는지를 자동으로 탐지하고, 해제하여 새로운 객체를 위한 공간을 확보한다. The garbage collector (GC) automatically manages the application's dynamic memory allocation requests. ✅ 예제Data data = new Data(); // x001이라는 참조값을 가진 객체 생성data = null; ..

Java/CS 2025.04.26

[프로그래머스 / Java] Lv.0 짝수 홀수 개수

Question https://school.programmers.co.kr/learn/courses/30/lessons/120824 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krCode💡 방법 1class Solution { public int[] solution(int[] num_list) { int[] result; int even = 0; int odd = 0; for(int i = 0; i * 배열 선언 및 초기화 1. 배열 선언 후 크기 지정int[] arr = new int[5]; 2. 선언과 초기화를 동..

Coding Test/Java 2025.04.26
반응형