Can the class have a function of its name?
Kotlin Quiz 4

Quiz
•
Computers
•
Professional Development
•
Hard
Mohamed Gamal
Used 2+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
true
false
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which declares an object correctly
class Human{}
fun main(){
val obj =
new Human()
}
class Human{}
fun main(){
val obj = Human()
}
class Human{}
fun main(){
val obj =
new Human();
}
class Human{}
fun main(){
val obj =
Human();
}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How to declare static members and methods?
class A{
static color: String = "Red"
}
class A{
static val color: String = "Red"
}
class A{
static var color = "Red"
}
class A{
companion object{
val color = "Red"
}}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
class A{
A(){
println("class A instantiated")
}
}
fun main(){
val a = A()
}
class A instantiated
"class A instantiated"
class A: "class A instantiated"
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
class Calculator(num1: Int, num2: Int){
fun add() = num1 + num2
}
fun main(){
val calc = Calculator(5,2)
println(calc.add())
}
7
9
11
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
which of the following is not OOP concept
Inheritance
Acbstraction
Polymorphism
Exception
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
fun main(){
val a = A()
println(10); println(5); println(8); }
class A{
init{
println(10)
println(5)
println(8)
}
}
10
5
8
10
5
8
10
5
8
10 5 8
10
5
8
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Js объекты

Quiz
•
Professional Development
10 questions
MATERIAL DIDACTICO - TEST JAVA- KHIPU

Quiz
•
Professional Development
10 questions
Jetpack Compose

Quiz
•
Professional Development
15 questions
Python Class 1

Quiz
•
Professional Development
17 questions
Java programming

Quiz
•
Professional Development
11 questions
Java Fundamentals

Quiz
•
Professional Development
16 questions
Fundamentals II. Final de módulo

Quiz
•
Professional Development
11 questions
Java full stack Assessment

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade