Search Header Logo

Swift Kotlin Grammar Tests

Authored by Symbat Nurgaliyeva

Science

University

Used 1+ times

Swift Kotlin Grammar Tests
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following syntaxes is correct for creating a constant in Swift?

let constantName = "Value"

const constantName = "Value"

var constantName = "Value"

constant constantName = "Value"

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to declare an immutable variable in Kotlin?

const val variableName = "Value"

let variableName = "Value"

var variableName = "Value"

val variableName = "Value"

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to check for null values in Kotlin?

== null

=== null

?.

!!

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of executing the expression "Hello".count() in Swift?

Compilation error

5

6

"Hello"

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to create a method in a class in Kotlin?

fun methodName() {}

method methodName() {}

def methodName() {}

function methodName() {}

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following syntaxes in Swift is used to declare an optional type?

var name: String?

var name: Optional(String)

var name: String!

var name: Optional<String>

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the !! operator mean in Kotlin?

Converts a nullable type to a non-nullable type, throwing an exception if null

Returns null

Checks the value for null

Sets a default value

Access all questions and much more by creating a free account

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?

Discover more resources for Science