전체 글
-
3장 - 함수 정의와 호출Kotlin/코틀린인액션요약 2022. 9. 11. 00:01
3장에서 다루는 내용 - 컬렉션, 문자열, 정규식을 다루기 위한 함수 - 이름 붙인 인자, 디폴트 파라미터 값, 중위 호출 문법 사용 - 확장 함수와 확장 프로퍼티를 사용해 자바 라이브러리 적용 - 최상위 및 로컬 함수와 프로퍼티를 사용해 코드 구조화 코틀린에서 컬렉션 만들기 var set = hashSetOf(1,7,53) // java.util.HashSet var list = arrayListOf(1,7,53) // java.util.ArrayList var map = hashMapOf(1 to "one", 7 to "seven", 53 to "fifty-three") // java.util.HashMap val Strings = listOf("first","second","fourteenth");..
-
[SSAFY/싸피] 싸피 7기 중도 퇴소 후기 / 싸피 후기회고 2022. 9. 10. 22:48
개요 공통 프로젝트가 끝나기 1~2주 전 LG U+ 인턴십 전형에 참여하기 위해 중도 퇴소하게 되었습니다. 프로젝트의 마무리는 거의 끝난 상황이었지만 끝까지 마무리하고 가지 못해 팀원들에게 죄송하다는 말씀을 다시 한번 드립니다 취업준비의 시작 국숙세단 라인의 컴퓨터공학과와 커리큘럼이 동일한 학과 전공(3.62/4.5) 재밌어서 협업 없이 혼자 진행했던 python flask기반 토이 프로젝트 3개, AWS 배포 2번 영어 스펙 X, 자격증 X 코딩테스트 공부 X 인턴, 연구실 경험 X 개인적으로 만들고 싶었던 서비스들만 혼자 만들어보았고 백엔드에 관심이 있었지만 Spring + Java에 대한 지식이 전무한 상황이었습니다. 2021년 10월부터 취준을 시작해야겠다고 마음을 먹게 되었습니다. 평소 토이 프..
-
2장 - 코틀린 기초Kotlin/코틀린인액션요약 2022. 9. 10. 00:01
2장에서 다루는 내용 - 함수, 변수 , 클래스 enum 프로퍼티를 선언하는 방법 - 코틀린의 여러 제어구조 - 스마트 캐스트 - 예외 던지기와 예외 잡기 단, 여기에서 배운 내용으로 작성하는 코드는 코틀린다운 코드라고 부르기는 어려움 함수와 변수 fun main(args: Array){ println("Hello,world!") } 함수를 선언할 때 fun 키워드를 사용합니다. 파라미터 이름 뒤에 그 파라미터의 타입을 씁니다. System.out.println 대신에 println을 사용합니다.(자바 라이브러리 함수를 간결하게 사용할 수 있는 래퍼를 제공합니다) 끝에 세미콜론(;)을 사용하지 않아도 됩니다. 함수 fun max(a: Int, b:Int) : Int{ return if(a>b) a els..
-
[Kotlin] Intellij 에서 코틀린 시작하기Kotlin/Kotlin 2022. 9. 9. 00:01
1. File -> New -> Project 경로 지정 및 프로젝트 이름 지정 JDK 설정 2. 잠시 후에 코틀린 프로젝트가 생성되고 화살표를 눌러 실행시켜봅니다. 결과 3. 자바코드 실행시켜 보기 public class HelloJava { public static void main(String[] args) { System.out.println("Hello Java"); } } Java 클래스를 하나 만들고 실행시켜봅니다. 컴파일 에러가 나올 수 있습니다. 1. File -> Project Structure -> Project or SDKs -> 내가 선택한 자바 버전 맞는지 확인 2. File -> Settings -> Java Compiler -> 내가 선택한 자바 버전 맞는지 확인 4. 자바코..
-
1장 - 코틀린소개Kotlin/코틀린인액션요약 2022. 9. 8. 00:01
코틀린이란? 코틀린은 자바 플랫폼에서 돌아가는 새로운 프로그래밍 언어입니다. 기존 자바 라이브러리와 프레임워크와 함께 잘 동작하며 성능도 자바와 같은 수준입니다. 코틀린의 철학은 간결하고 실용적이며, 자바 코드와의 상호운영성을 중시합니다. 코틀린 맛보기 // 데이터 클래스 data class Person( val name: String, val age: Int? = null // 널이 될 수 있는 타입과 파라미터 디폴트 값 ) // 최상위 함수 fun main(args: Array) { val persons = listOf( Person("Alice"), Person("Bob", age = 29) ) val oldest = persons.maxBy { it.age ?: 0 } // 람다 식과 엘비스 연산..
-
동적쿼리란? with QuerydslJPA 2022. 9. 7. 00:01
정적 쿼리란? 어떤 조건 상황에도 변경되지 않는 쿼리문 동적 쿼리란? 상황에 따라 다른 문법의 SQL을 적용하는 것을 뜻합니다. 보통 선택적인 옵션에 따라 데이터 검색이 가능한 경우 사용합니다. DB에서 값을 조회할 때 조회 조건이 동적으로 바뀌어야 하는 경우가 많습니다. 이런 상황을 Querydsl을 사용하면 손쉽게 해결할 수 있습니다. name 값이 들어오면 WHERE name = ${name} age 값이 들어오면 WHERE age = ${age} name과 age가 모두 들어오면 WHERE name = ${name} AND age = ${age} name과 age 모두 들어오지 않으면 WHERE 절을 사용하지 않습니다. 이런 상황들을 어떻게 해결해야 할까요? 1. 순수 JPQL로 해결하기 jpql..
-
컬렉션 API 개선Java/모던자바인액션요약 2022. 9. 6. 00:01
거의 모든 자바 애플리케이션에서 컬렉션을 사용합니다. 하지만 컬렉션을 에러를 유발하는 여러 단점들이 존재합니다. 자바 8,9에 추가되어 우리의 삶을 편리하게 만들어 줄 새로운 컬렉션 API 기능들을 배워보는 시간입니다. 리스트 만들기 List friends = new ArrayList(); friends.add("element1"); friends.add("element2"); friends.add("element3"); Arrays.asList() 팩토리 메서드를 이용하면 코드를 간결하게 줄일 수 있다. List friends = Arrays.asList("element1","element2","element3"); 마찬가지로 List.of 팩토리 메서드를 이용해서도 간단하게 리스트를 만들 수 있습니다..
-
[백준] 11286번 : 절댓값 힙 - 자바(JAVA)알고리즘/백준 2022. 9. 5. 00:01
https://www.acmicpc.net/problem/11286 11286번: 절댓값 힙 첫째 줄에 연산의 개수 N(1≤N≤100,000)이 주어진다. 다음 N개의 줄에는 연산에 대한 정보를 나타내는 정수 x가 주어진다. 만약 x가 0이 아니라면 배열에 x라는 값을 넣는(추가하는) 연산이고, x가 0 www.acmicpc.net 문제 해석 절댓값이 작은 순서대로 정렬을 해주는 문제입니다. 그리고 가장 작은 순서대로 뽑아내고 절댓값이 동일한다면 음수가 우선순위를 가집니다. 문제 풀이 전 설계 PriorityQueue(우선순위 큐)를 활용합니다. 또한 Number 클래스를 두고 절대값의 크기(num), 이 수가 음수인지 양수인지를 기록합니다. 그리고 절대값의 크기가 같다면 음수가 더 우선순위를 가지며 절..