프로그래밍 공부
-
[Spring] spring 소개프로그래밍 공부/Spring 2021. 4. 28. 10:22
뉴렉쳐 강사님의 동영상 강의를 듣고 정리한 내용입니다. 스프링 사용 이유 : 엔터프라이즈 애플리케이션을 제작하는 것에 중요한 특징 두가지를 포함하고 있음. - dependency injection (-> 모듈 결합을 쉽게 해줌) - transaction management JAVA EE(Enterprise Edition)도 위의 기능을 지원하지만, 스프링에 비해 복잡도가 높아 스프링을 대신 사용하게 됨 추가로.. spring이 나오면서 EE가 유료화됨. 엔터프라이즈 애플리케이션이란.. - 지속적 데이터(persistent data)를 처리 - 막대한 양의 데이터를 처리 - 여러 사람이 동시에 데이터에 접근 - 많은 데이터를 처리하기 위한 사용자 인터페이스 화면의 수도 많음 - 단독으로 운영되는 경우가 거..
-
[JAVA] I/O BufferedReader와 StringBuilder프로그래밍 공부/JAVA 2021. 3. 24. 00:16
알고리즘 문제를 풀다 보면 메모리나 경과 시간이 중요한 문제들이 있다. 이 경우에 같은 코드를 작성하더라도 Scanner를 사용하면 메모리 초과가 나타나는 경우가 있다. Scanner보다 버퍼리더를 사용하기가 코드가 복잡해서 안 사용하고 있었는데 위와 같은 경우를 3번 정도 경험하니 BufferedReader 사용을 습관화하기 위해 정리를 한다.. 알고리즘 문제에서 출력이 많이 요구되는데 시간 초과가 나는 경우 StringBuilder를.. 메모리에서 초과가 나는 경우 BufferedReader를 사용하면 문제가 해결될 수도..? 실제로 성능을 비교해보면 Buffer가 훨씬 우세하다. Buffer를 사용하기 위해선 여러가지 import 또한 필요하다. import java.util.* 와 import j..
-
[JAVA] 정렬(Sorting)프로그래밍 공부/JAVA 2021. 3. 8. 20:12
Arrays.sort 자바에서 제공해주는 sort 메서드를 이용하여 쉽게 배열을 정렬할 수 있다. 오름차순 정렬(default): Arrays.sort() import java.util.Arrays //정렬 메서드를 사용하기 위해 포함한다. public class Main{ public static void main(String[] args){ int[] intArray = {5,1,3,2,4}; String[] stringArray = {"banana", "apple", "peach"}; Arrays.sort(intArray);//결과: 1,2,3,4,5 Arrays.sort(stringArray);//결과: "apple", "banana", "peach" } } 숫자와 문자와 같이 복합적으로 나타나는..
-
[JAVA] 형변환프로그래밍 공부/JAVA 2021. 3. 6. 11:59
String to int String s = "10"; int i = Integer.valueOf(s); int i = Integer.parseInt(s); //String -> double double d = Double.valueOf(s); //String -> float float f = Float.valueOf(s); int to String int i = 10; String s = String.valueOf(i); String s = Integer.toString(i); 정수 실수 //실수 -> 정수 double d = 10.10; float f = 10.10; int i = (int)d //i=10; int i = (int)f //i=10; //정수 -> 실수 int i = 10; double..
-
[JAVA] Collection 자료구조 정리프로그래밍 공부/JAVA 2021. 3. 4. 23:02
List : 배열과 비슷한 자료형, 원소의 개수가 가변적일 때 사용한다. - add(val): 배열에 끝에 val 삽입 - add(idx, val): idx 위치에 val 삽입 - set(idx, val): idx 위치의 원소를 val 값으로 변경 - get(idx): idx에 해당하는 값을 반환 - size(): 리스트의 개수 반환 - contains(val): 리스트에 val이 있다면 true 반환 - remove(val): val 삭제 후 삭제 결과 반환(true/false) - remove(idx): idx위치 값 삭제 후삭제된 항목 반환 - clear(): 리스트의 모든 값 삭제 ArrayList : List 인터페이스를 구현한 클래스 LinkedList : 원소들을 인덱스로 관리하는 array..