Kotlin Quiz 4

Kotlin Quiz 4

Professional Development

12 Qs

quiz-placeholder

Similar activities

Revisão HTML / CSS - CEMI

Revisão HTML / CSS - CEMI

Professional Development

14 Qs

CyberCrime

CyberCrime

5th Grade - Professional Development

10 Qs

Unit-1-ICT-Basics

Unit-1-ICT-Basics

Professional Development

10 Qs

Menus, Dialog Boxes and Methods

Menus, Dialog Boxes and Methods

10th Grade - Professional Development

17 Qs

Java_1

Java_1

Professional Development

10 Qs

Fortnite skins and dances code 363218

Fortnite skins and dances code 363218

KG - Professional Development

10 Qs

Python Basics

Python Basics

Professional Development

10 Qs

Digital etiquette

Digital etiquette

KG - Professional Development

16 Qs

Kotlin Quiz 4

Kotlin Quiz 4

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

Mohamed Gamal

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can the class have a function of its name?

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?