41. val short for Value, a constant which cannot be changed once assigned?
42. The function typeChecker receiver a parameter obj of type Any. Based upon the type of obj, it prints different messages for Int, String, Double, and Float types; if not any of the mentioned types, it prints "unknown type". What operator allows you to determine the type of an object?
43. You have created a class that should be visible only to the other code in its module. Which modifier do you use?
44. You are upgrading a Java class to Kotlin. What should you use to replace the Java class's static fields?
45. You are writing a console app in Kotlin that processes test entered by the user. If the user enters an empty string, the program exits. Which kind of loop would work best for this app? Keep in mind that the loop is entered at least once
46. You are attempting to assign an integer variable to a long variable, but Kotlin compiler flags it as an error. Why?
47. Which line of code shows how to display a nullable string's length and shows 0 instead of null?
48. Kotlin interfaces and abstract classes are very similar. What is one thing abstract class can do that interfaces cannot?
49. Inside an extension function, what is the name of the variable that corresponds to the receiver object
50. Which is the proper way to declare a singleton named DatabaseManager?
Read More Section(Kotlin Program)
Each Section contains maximum 100 MCQs question on Kotlin Program. To get more questions visit other sections.
