Skip to content

Commit

Permalink
kotlin 기본
Browse files Browse the repository at this point in the history
  • Loading branch information
runnz121 committed Nov 4, 2023
1 parent 9f6d6c7 commit 86d1846
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 2 deletions.
Binary file not shown.
Empty file.
Binary file removed .gradle/7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file removed .gradle/7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/7.1/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file removed .gradle/7.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file removed .gradle/7.1/gc.properties
Empty file.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.9.20'
}

group 'org.example'
Expand All @@ -13,8 +14,19 @@ dependencies {
implementation 'junit:junit:4.13.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}

test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ public class Integer_in_two_circles {

public long solution(int r1, int r2) {


return answer;
return 1;
}

public static void main(String[] args) {
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/algorithmKotlin/sample/sample.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package algorithmKotlin.sample

import java.time.DayOfWeek

fun main() {
println("kotlin start")

println(varFunc())

println(valFunc())

println(forFun())

println(forFunStep())
}

fun varFunc() : Int {
var res : Int = 5

res = 7

return res
}

fun valFunc() : Int {

val res : Int = 6

return res
}

fun forFun() : Int {
var sum = 0
for (i in 1..10) {
sum += i
}
return sum
}

fun forFunStep() : Int {
var step = 0

for (i in 10 downTo 5 step 2) {
step += i
}
return step
}

fun whenFun(dayOfWeek: DayOfWeek) {


}

0 comments on commit 86d1846

Please sign in to comment.