Font size
WorksheetsDart Lang Full Quiz
Total questions: 97
Worksheet time: 5hrs 51mins
What is the default value of uninitialized variables in Dart?
0
false
null
undefined
Which of the following is a valid data type in Dart?
word
int
number
digit
Which keyword is used to declare a constant value known at compile time?
final
late
const
static
Which operator is used for string interpolation?
@
#
$
%
Which collection type does NOT allow duplicate values?
List
Set
Map
Queue
What does the `.length` property return for a String?
Number of words
Number of lines
Number of characters
Number of spaces
Which object represents a point in time?
Duration
DateStamp
DateTime
TimeCode
Which operator checks if two objects are identical in memory?
==
=
identical()
!=
Which method converts a String to an int?
int.tryParse()
int.parse()
toInt()
parseInt()
Which keyword is used to create a class?
object
class
struct
template
Which access modifier makes a member private in Dart?
private
hidden
_ (underscore)
secret
Which loop is guaranteed to run at least once?
for
while
do-while
for-in
Which is used to define optional named parameters?
[ ]
( )
{ }
Which function type returns nothing?
void
empty
null
none
Which keyword is used to handle exceptions?
error
catch
handle
break
Which of the following is NOT a type test operator?
is
is!
as
like
What is the super keyword used for?
Destroy objects
Access parent class
Hide methods
Create static methods
Which of the following creates an anonymous function?
fn() {}
() {}
anon()
lambda {}
What does the “mixins” feature allow?
Multiple inheritance
Sharing code between classes
Creating static classes
Passing functions by reference
Which method is used with iterators?
run()
call()
moveNext()
start()
Which constructor cannot be instantiated?
factory
const
abstract class constructor
named
Which keyword marks a variable that will be initialized later?
late
after
lazy
defer
Which collection stores key/value pairs?
List
Set
Map
Queue
Which operator performs null-aware assignment?
??
?:
&&
!
Which type of inheritance is NOT supported in Dart?
Single
Multilevel
Hierarchical
Multiple inheritance of classes
Which keyword is used to import another file?
include
import
using
require
Which parameter type has no default value?
required
optional positional
optional named
required named
Which operator is used for integer division?
/
~/
%
//
Which keyword creates a named constructor?
named
const
className.name
static
Which method executes when calling a callable class?
main()
run()
call()
invoke()
What does the “final” keyword mean?
Value known at compile time
Value unchangeable after initialization
Mutable
Can be reassigned
Which of these is a built-in type?
num
value
data
real
Which statement stops the current loop?
end
return
break
stop
Which exception is thrown for division by zero?
FormatException
IntegerDivisionByZeroException
ZeroException
NullThrownError
Which feature ensures variables can’t hold null unless allowed?
Safety mode
Null security
Sound null safety
Type lock
Which map constructor keeps insertion order?
HashMap
LinkedHashMap
SplayTreeMap
QueueMap
Which is true about mixins?
They have constructors
Can’t be instantiated
They extend other mixins
They require interfaces
Which operator is unary?
+
-
!
==
Which method is used to add an element to a list?
include()
push()
add()
insertLast()
Which operator is used for type conversion casting?
convert
as
to
cast
Which loop works with collections directly?
for
for-in
do-while
lambda for
What is the purpose of the assert statement?
Throw runtime errors
Validate conditions during debugging
Stop compilation
Print errors
Which statement is used to define a typedef?
typedef myFunc = int;
typedef MyFunc(int x);
typedef MyFunc = int Function(int);
def myFunc(int)
Which keyword creates a static member?
const
final
static
native
Which operator returns true if both operands are true?
&
&&
||
^^
Which collection allows sorted keys automatically?
LinkedHashMap
HashMap
SplayTreeMap
Map
If both operands are true?
&
&&
||
^^
Which collection allows sorted keys automatically?
LinkedHashMap
HashMap
SplayTreeMap
Map
What does a factory constructor allow?
Runtime calculation
Multiple inheritance
Changing class name
Creating private classes
Which class cannot be instantiated?
Base
Normal class
Abstract class
Parent class
What does “override” do?
Replace parent method
Delete a method
Hide a class
Stop execution
Which operator checks if value is null?
??
!=
is!
== null
Dart is a statically typed language.
False
True
In Dart, every class implicitly defines an interface.
False
True
The "var" keyword means the type cannot change after assignment.
False
True
A const variable must be known at runtime.
True
False
Set allows duplicate elements.
True
False
The “late” keyword prevents null errors by delaying initialization.
False
True
A class can extend multiple classes in Dart.
True
False
Optional named parameters are written inside {} brackets.
False
True
The default constructor has no parameters.
False
True
An abstract class may contain non-abstract methods.
False
True
The "on" keyword can catch specific exception types.
False
True
Mixins can define constructors.
True
False
A factory constructor must always return a new object.
True
False
The call() method makes classes callable.
False
True
The try–catch block can have multiple catch statements.
False
True
The spread operator (…) is used with collections.
False
True
Dart supports top-level functions.
False
True
Static variables belong to the class, not the object.
False
True
Null safety allows non-nullable variables to be null.
True
False
Interfaces in Dart use the “interface” keyword.
True
False
Which statement is used to define a record?
{}
[]
( ) with named or positional fields
<>
Which operator checks type at runtime?
as
is
cast
check
What is the return type of runes?
List
Runes
Unicode
CharList
Which function is used with regex?
match()
filter()
hasMatch()
scan()
Which list constructor creates a fixed-length list?
List()
List.filled()
List.empty(growable:true)
List.mutable()
Which keyword prevents variable reassignment?
let
var
final
assign
Which map type sorts keys automatically?
HashMap
SplayTreeMap
LinkedHashMap
MutableMap
Which class handles durations?
Time
Duration
Interval
Range
Which operator assigns a value only if target is null?
??=
||=
&&=
==
What does the keyword “required” apply to?
Named parameters
Positional parameters
Static methods
Constructors
Which access type are top-level variables by default?
private
protected
public
internal
Which statement copies values using cascade operator?
..
::
=>
<>
Which of the following is a relational operator?
!==
>=
=
&
Which looping method is used with iterators?
forEach
iterate
while(moveNext())
for-in only
Which error type occurs when accessing null value?
NullThrownError
NullCheckError
EmptyError
MissingValueError
Which method adds key/value to a map?
push()
add()
put()
map[key] = value
Which operator is used in conditional expressions?
?:
&&
A callable class must contain which method?
run()
call()
exec()
function()
Which reserved word creates inheritance?
extends
implements
mixin
with
Which keyword implements an interface?
derive
use
implements
override
Which collection maintains insertion order?
HashMap
LinkedHashMap
SplayTreeMap
UnorderedMap
Which type is supertype for int and double?
Object
Number
num
numeric
Which method checks if a list is empty?
list.clear()
list.hasItems()
list.isEmpty
list.size()
Which statement imports only a specific part of a library?
import 'lib.dart' include part;
import 'lib.dart' as x;
import 'lib.dart' show functionName;
using lib.dart
Which method converts a double to int?
toInt()
int.parse()
toInteger()
castInt()
