Kotlin for Java developers quiz 返回到衔接课程 Kotlin is ___ interoperable with the Java programming language. 50% 90% 98% 100% True or false? The conversion process in Android Studio produces functionally equivalent Kotlin code that compiles and runs. True. False. Match the descriptions of how Kotlin generates in JVM bytecode with the correct annotations. 每项回答仅与一项匹配。 Generates static members and methods @JvmField @Throws @JvmName @JvmStatic @JvmOverloads Generates overloaded methods for functions that have default values @JvmField @Throws @JvmName @JvmStatic @JvmOverloads Changes the name of getters and setters @JvmField @Throws @JvmName @JvmStatic @JvmOverloads Exposes a property directly as a field, rather than via getters and setters @JvmField @Throws @JvmName @JvmStatic @JvmOverloads Declares checked exceptions @JvmField @Throws @JvmName @JvmStatic @JvmOverloads What are different ways you can incorporate Kotlin into an existing Android app written in the Java programming language? 选择合适的多项回答。 Add a new Kotlin class to your project (for example, a new Activity). Migrate a portion of your app to Kotlin. Write new tests in Kotlin. Move utility methods to Kotlin extension functions. None of these choices apply. Which of the following statements are true in regards to Kotlin providing null safety? 选择合适的多项回答。 Null does not exist in Kotlin. By default, Kotlin variables can't hold null values. If you want a variable to hold a null value, use ? on the data type to specify that it is of a nullable type. In Kotlin, null means 0 for integers or empty string for strings. Use the safe call operator ?. as a convenient way to check if a property is null before continuing to evaluate the expression. Assume you have declared a function in Kotlin that contains default values for all three of its parameters. Which of these statements are true about calling such a function? 选择合适的多项回答。 You can call the function with no arguments. You can call the function and use named arguments. You can call the function with all arguments present. The function declaration won’t compile, so you cannot call this function. 提交回答 error_outline 系统对测验进行评分时出现错误。请重试。