wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Dart Lang Full Quiz

Total questions: 97

Worksheet time: 5hrs 51mins

Name
Class
Date
1.

What is the default value of uninitialized variables in Dart?

a)

0

b)

false

c)

null

d)

undefined

2.

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

a)

word

b)

int

c)

number

d)

digit

3.

Which keyword is used to declare a constant value known at compile time?

a)

final

b)

late

c)

const

d)

static

4.

Which operator is used for string interpolation?

a)

@

b)

#

c)

$

d)

%

5.

Which collection type does NOT allow duplicate values?

a)

List

b)

Set

c)

Map

d)

Queue

6.

What does the `.length` property return for a String?

a)

Number of words

b)

Number of lines

c)

Number of characters

d)

Number of spaces

7.

Which object represents a point in time?

a)

Duration

b)

DateStamp

c)

DateTime

d)

TimeCode

8.

Which operator checks if two objects are identical in memory?

a)

==

b)

=

c)

identical()

d)

!=

9.

Which method converts a String to an int?

a)

int.tryParse()

b)

int.parse()

c)

toInt()

d)

parseInt()

10.

Which keyword is used to create a class?

a)

object

b)

class

c)

struct

d)

template

11.

Which access modifier makes a member private in Dart?

a)

private

b)

hidden

c)

_ (underscore)

d)

secret

12.

Which loop is guaranteed to run at least once?

a)

for

b)

while

c)

do-while

d)

for-in

13.

Which is used to define optional named parameters?

a)

[ ]

b)

( )

c)

{ }

d)
14.

Which function type returns nothing?

a)

void

b)

empty

c)

null

d)

none

15.

Which keyword is used to handle exceptions?

a)

error

b)

catch

c)

handle

d)

break

16.

Which of the following is NOT a type test operator?

a)

is

b)

is!

c)

as

d)

like

17.

What is the super keyword used for?

a)

Destroy objects

b)

Access parent class

c)

Hide methods

d)

Create static methods

18.

Which of the following creates an anonymous function?

a)

fn() {}

b)

() {}

c)

anon()

d)

lambda {}

19.

What does the “mixins” feature allow?

a)

Multiple inheritance

b)

Sharing code between classes

c)

Creating static classes

d)

Passing functions by reference

20.

Which method is used with iterators?

a)

run()

b)

call()

c)

moveNext()

d)

start()

21.

Which constructor cannot be instantiated?

a)

factory

b)

const

c)

abstract class constructor

d)

named

22.

Which keyword marks a variable that will be initialized later?

a)

late

b)

after

c)

lazy

d)

defer

23.

Which collection stores key/value pairs?

a)

List

b)

Set

c)

Map

d)

Queue

24.

Which operator performs null-aware assignment?

a)

??

b)

?:

c)

&&

d)

!

25.

Which type of inheritance is NOT supported in Dart?

a)

Single

b)

Multilevel

c)

Hierarchical

d)

Multiple inheritance of classes

26.

Which keyword is used to import another file?

a)

include

b)

import

c)

using

d)

require

27.

Which parameter type has no default value?

a)

required

b)

optional positional

c)

optional named

d)

required named

28.

Which operator is used for integer division?

a)

/

b)

~/

c)

%

d)

//

29.

Which keyword creates a named constructor?

a)

named

b)

const

c)

className.name

d)

static

30.

Which method executes when calling a callable class?

a)

main()

b)

run()

c)

call()

d)

invoke()

31.

What does the “final” keyword mean?

a)

Value known at compile time

b)

Value unchangeable after initialization

c)

Mutable

d)

Can be reassigned

32.

Which of these is a built-in type?

a)

num

b)

value

c)

data

d)

real

33.

Which statement stops the current loop?

a)

end

b)

return

c)

break

d)

stop

34.

Which exception is thrown for division by zero?

a)

FormatException

b)

IntegerDivisionByZeroException

c)

ZeroException

d)

NullThrownError

35.

Which feature ensures variables can’t hold null unless allowed?

a)

Safety mode

b)

Null security

c)

Sound null safety

d)

Type lock

36.

Which map constructor keeps insertion order?

a)

HashMap

b)

LinkedHashMap

c)

SplayTreeMap

d)

QueueMap

37.

Which is true about mixins?

a)

They have constructors

b)

Can’t be instantiated

c)

They extend other mixins

d)

They require interfaces

38.

Which operator is unary?

a)

+

b)

-

c)

!

d)

==

39.

Which method is used to add an element to a list?

a)

include()

b)

push()

c)

add()

d)

insertLast()

40.

Which operator is used for type conversion casting?

a)

convert

b)

as

c)

to

d)

cast

41.

Which loop works with collections directly?

a)

for

b)

for-in

c)

do-while

d)

lambda for

42.

What is the purpose of the assert statement?

a)

Throw runtime errors

b)

Validate conditions during debugging

c)

Stop compilation

d)

Print errors

43.

Which statement is used to define a typedef?

a)

typedef myFunc = int;

b)

typedef MyFunc(int x);

c)

typedef MyFunc = int Function(int);

d)

def myFunc(int)

44.

Which keyword creates a static member?

a)

const

b)

final

c)

static

d)

native

45.

Which operator returns true if both operands are true?

a)

&

b)

&&

c)

||

d)

^^

46.

Which collection allows sorted keys automatically?

a)

LinkedHashMap

b)

HashMap

c)

SplayTreeMap

d)

Map

47.

If both operands are true?

a)

&

b)

&&

c)

||

d)

^^

48.

Which collection allows sorted keys automatically?

a)

LinkedHashMap

b)

HashMap

c)

SplayTreeMap

d)

Map

49.

What does a factory constructor allow?

a)

Runtime calculation

b)

Multiple inheritance

c)

Changing class name

d)

Creating private classes

50.

Which class cannot be instantiated?

a)

Base

b)

Normal class

c)

Abstract class

d)

Parent class

51.

What does “override” do?

a)

Replace parent method

b)

Delete a method

c)

Hide a class

d)

Stop execution

52.

Which operator checks if value is null?

a)

??

b)

!=

c)

is!

d)

== null

53.

Dart is a statically typed language.

a)

False

b)

True

54.

In Dart, every class implicitly defines an interface.

a)

False

b)

True

55.

The "var" keyword means the type cannot change after assignment.

a)

False

b)

True

56.

A const variable must be known at runtime.

a)

True

b)

False

57.

Set allows duplicate elements.

a)

True

b)

False

58.

The “late” keyword prevents null errors by delaying initialization.

a)

False

b)

True

59.

A class can extend multiple classes in Dart.

a)

True

b)

False

60.

Optional named parameters are written inside {} brackets.

a)

False

b)

True

61.

The default constructor has no parameters.

a)

False

b)

True

62.

An abstract class may contain non-abstract methods.

a)

False

b)

True

63.

The "on" keyword can catch specific exception types.

a)

False

b)

True

64.

Mixins can define constructors.

a)

True

b)

False

65.

A factory constructor must always return a new object.

a)

True

b)

False

66.

The call() method makes classes callable.

a)

False

b)

True

67.

The try–catch block can have multiple catch statements.

a)

False

b)

True

68.

The spread operator (…) is used with collections.

a)

False

b)

True

69.

Dart supports top-level functions.

a)

False

b)

True

70.

Static variables belong to the class, not the object.

a)

False

b)

True

71.

Null safety allows non-nullable variables to be null.

a)

True

b)

False

72.

Interfaces in Dart use the “interface” keyword.

a)

True

b)

False

73.

Which statement is used to define a record?

a)

{}

b)

[]

c)

( ) with named or positional fields

d)

<>

74.

Which operator checks type at runtime?

a)

as

b)

is

c)

cast

d)

check

75.

What is the return type of runes?

a)

List

b)

Runes

c)

Unicode

d)

CharList

76.

Which function is used with regex?

a)

match()

b)

filter()

c)

hasMatch()

d)

scan()

77.

Which list constructor creates a fixed-length list?

a)

List()

b)

List.filled()

c)

List.empty(growable:true)

d)

List.mutable()

78.

Which keyword prevents variable reassignment?

a)

let

b)

var

c)

final

d)

assign

79.

Which map type sorts keys automatically?

a)

HashMap

b)

SplayTreeMap

c)

LinkedHashMap

d)

MutableMap

80.

Which class handles durations?

a)

Time

b)

Duration

c)

Interval

d)

Range

81.

Which operator assigns a value only if target is null?

a)

??=

b)

||=

c)

&&=

d)

==

82.

What does the keyword “required” apply to?

a)

Named parameters

b)

Positional parameters

c)

Static methods

d)

Constructors

83.

Which access type are top-level variables by default?

a)

private

b)

protected

c)

public

d)

internal

84.

Which statement copies values using cascade operator?

a)

..

b)

::

c)

=>

d)

<>

85.

Which of the following is a relational operator?

a)

!==

b)

>=

c)

=

d)

&

86.

Which looping method is used with iterators?

a)

forEach

b)

iterate

c)

while(moveNext())

d)

for-in only

87.

Which error type occurs when accessing null value?

a)

NullThrownError

b)

NullCheckError

c)

EmptyError

d)

MissingValueError

88.

Which method adds key/value to a map?

a)

push()

b)

add()

c)

put()

d)

map[key] = value

89.

Which operator is used in conditional expressions?

a)

?:

b)
c)

&&

90.

A callable class must contain which method?

a)

run()

b)

call()

c)

exec()

d)

function()

91.

Which reserved word creates inheritance?

a)

extends

b)

implements

c)

mixin

d)

with

92.

Which keyword implements an interface?

a)

derive

b)

use

c)

implements

d)

override

93.

Which collection maintains insertion order?

a)

HashMap

b)

LinkedHashMap

c)

SplayTreeMap

d)

UnorderedMap

94.

Which type is supertype for int and double?

a)

Object

b)

Number

c)

num

d)

numeric

95.

Which method checks if a list is empty?

a)

list.clear()

b)

list.hasItems()

c)

list.isEmpty

d)

list.size()

96.

Which statement imports only a specific part of a library?

a)

import 'lib.dart' include part;

b)

import 'lib.dart' as x;

c)

import 'lib.dart' show functionName;

d)

using lib.dart

97.

Which method converts a double to int?

a)

toInt()

b)

int.parse()

c)

toInteger()

d)

castInt()