Kotlin(Computer Science ) Questions and Answers

Question 1. What is the best known programming language ever?
  1.    Python
  2.    Kotlin
  3.    Java
  4.    SQL
Explanation:-
Answer: Option C. -> Java

Question 2. Do booleans Need to be Capitalized on the first letter?
  1.    Yes
  2.    It depends
  3.    No
  4.    All of above
Explanation:-
Answer: Option A. -> Yes

Question 3. Which is the correct data class?
  1.    class DataUser(name : String, address : String)
  2.    data class DataUser(name : String, address : String)
  3.    data class DataUser(val name : String, val address : String)
  4.    open data class DataUser(val name : String, val address : String)
Explanation:-
Answer: Option C. -> data class DataUser(val name : String, val address : String)

Question 4. Manakah OS di bawah ini yang Open Source?
  1.    Android
  2.    Linux
  3.    Mac OS
  4.    Both A & B
Explanation:-
Answer: Option D. -> Both A & B

Question 5. Which keyword used to create a mutable variable?
  1.    var
  2.    val
  3.    const
  4.    mutable
Explanation:-
Answer: Option A. -> var

Question 6. Which the right code to declare nullable variable in Kotlin?
  1.    val text: String = null
  2.    val text: String? = null
  3.    val text: nullable = null
  4.    val text: String
Explanation:-
Answer: Option B. -> val text: String? = null

Question 7. Which is the right declaration to make a variable with the Character data type?
  1.    val char = 'ABC'
  2.    val char = "A"
  3.    val char = 'A'
  4.    val char = A
Explanation:-
Answer: Option C. -> val char = 'A'

Question 8. What value is 10 until 12
  1.    10 11 12
  2.    10 11
  3.    11 12
  4.    All is wrong!
Explanation:-
Answer: Option B. -> 10 11

Question 9. Which ways can you use for an HTML file?
  1.    .htm
  2.    .html
  3.    .tml
  4.    Both A & B
Explanation:-
Answer: Option D. -> Both A & B

Question 10. What is Java used on?
  1.    Wifi Routers
  2.    Blu-Ray Players
  3.    Operating Systems
  4.    All of above
Explanation:-
Answer: Option D. -> All of above