Bird
0
0

Given this Gradle Kotlin DSL snippet, what will be the output directory for compiled Kotlin classes?

medium📝 Predict Output Q4 of 15
Kotlin - Basics and JVM Runtime
Given this Gradle Kotlin DSL snippet, what will be the output directory for compiled Kotlin classes? plugins { kotlin("jvm") version "1.8.0" } java { sourceSets { main { java.srcDirs("src/main/kotlin") output.resourcesDir = file("build/resources/main") } } }
Abuild/classes/kotlin/main
Bbuild/classes/java/main
Cbuild/resources/main
Dsrc/main/kotlin
Step-by-Step Solution
Solution:
  1. Step 1: Understand output directories in Gradle

    Compiled Kotlin classes go to build/classes/kotlin/main by default.
  2. Step 2: Note resourcesDir setting

    output.resourcesDir changes resource output, not class files location.
  3. Final Answer:

    build/classes/kotlin/main -> Option A
  4. Quick Check:

    Compiled classes output = build/classes/kotlin/main [OK]
Quick Trick: Compiled Kotlin classes go to build/classes/kotlin/main by default [OK]
Common Mistakes:
MISTAKES
  • Confusing resource output with class output
  • Assuming output goes to src folder
  • Choosing build/classes/java/main for Kotlin classes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes