Kotlin Variables and Data Types
Kotlin Variables and Data Types - Important Points
| 6. | Which of the following data types in Kotlin is used to represent characters? |
|---|
A. Char
B. String
C. Int
D. Float
View Answer Discuss Work SpaceAnswer: option a
Explanation:
| 7. | What is the output of the following Kotlin code? fun main() { |
|---|
A. Hello, $name!
B. Hello, John!
C. Hello, {name}!
D. Hello, {John}!
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 8. | Which of the following is a valid Kotlin variable name? |
|---|
A. myVariableName
B. MyVariableName
C. my-variable-name
D. 1myvariablename
View Answer Discuss Work SpaceAnswer: option a
Explanation:
| 9. | What is the output of the following Kotlin code? fun main() { |
|---|
A. 5
B. 7
C. num + 2
D. 5 + 2
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 10. | Which of the following data types in Kotlin is used to represent true or false values? |
|---|
A. Char
B. String
C. Int
D. Boolean
View Answer Discuss Work SpaceAnswer: option d
Explanation: