wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

1st session

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is Dart primarily used for?

a)

Backend development

b)

Mobile app development

c)

Desktop applications

d)

Game development

2.

Which of the following is NOT a valid data type in Dart?

a)

int

b)

float

c)

bool

d)

string

3.

How do you create a nullable variable in Dart?

a)

int value;

b)

int value!;

c)

int? value;

d)

nullable int value;

4.

What is the purpose of the ! operator in Dart?

a)

To declare a nullable variable

b)

To check if a value is null

c)

To negate a boolean value

d)

To force a nullable value to be treated as non-null

5.

What does the following code output?
void main() {
var a = 5, b = 3;
print(a ~/ b);
}

a)

1.6666

b)

1

c)

2

d)

Error

6.

What is the output of the following code?
void main() {

var x = 10;

print(x is String);

}

a)

true

b)

false

c)

error

d)

null

7.

Which method is used to add an item to a list in Dart?

a)

addItem()

b)

append()

c)

add()

d)

push()

8.

What is the purpose of the late keyword in Dart?

a)

Declares a variable that must be initialized later

b)

Declares a constant variable

c)

Declares a nullable variable

d)

Declares a variable with no type

9.

What is the output of the following code?
void main() {

String? name;

print(name ?? 'No Name');

}

a)

null

b)

No Name

c)

Error

d)

Empty string

10.

What is the difference between const and final in Dart?

a)

final is used for runtime constants, and const is used for compile-time constants.

b)

Both are identical in Dart.

c)

const allows reassignment, while final does not.

d)

final variables are immutable, while const variables are not.

11.

What does the dynamic keyword in Dart allow you to do?

a)

Declare variables that cannot change type.

b)

Declare variables with no fixed type that can change dynamically.

c)

Declare variables that hold only strings.

d)

Declare immutable variables.

12.

What is encapsulation in OOP?

a)

Hiding the implementation details and exposing only what is necessary.

b)

Creating multiple methods with the same name.

c)

Converting an object to another type.

d)

Inheriting from another class.

13.

What will the following code output?

class Animal {

void speak() => print('Animal speaks');

}

class Dog extends Animal {

@override

void speak() => print('Dog barks');

}

void main() {

Animal myPet = Dog();

myPet.speak();

}

a)

Animal speaks

b)

Dog barks

c)

Error

d)

null

14.

What will the following code output?
void main() {

final List<int> numbers = [1, 2, 3];

numbers[0] = 4;

print(numbers);

}

a)

[4, 2, 3]

b)

Error: Cannot modify a final list

c)

[1, 2, 3]

d)

Error: Cannot assign to an unmodifiable list

15.

What feature of Flutter allows you to see changes in your app instantly without restarting?

a)

Cold start

b)

Warm Start

c)

Quick Refresh

d)

Hot Restart