ExamVeda
Login
Home
41
val short for Value, a constant which cannot be changed once assigned?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
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?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
43
You have created a class that should be visible only to the other code in its module. Which modifier do you use?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
You are upgrading a Java class to Kotlin. What should you use to replace the Java class's static fields?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
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
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
46
You are attempting to assign an integer variable to a long variable, but Kotlin compiler flags it as an error. Why?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
47
Which line of code shows how to display a nullable string's length and shows 0 instead of null?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
48
Kotlin interfaces and abstract classes are very similar. What is one thing abstract class can do that interfaces cannot?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
49
Inside an extension function, what is the name of the variable that corresponds to the receiver object
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
50
Which is the proper way to declare a singleton named DatabaseManager?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board