Module 4 Flashcards

1
Q

A _________ is a set of statements to perform a specific task.

A

function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

_________ organize the program into logical blocks of code.

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

_________ may be called to access code.

A

functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

_________ are the building blocks of readable, maintainable, and
reusable code.

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

_________ {
// main function goes here
}

A

main()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A function must be called to execute it. This process is
termed as _________.

A

function invocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

_________ may also return value along with the control, back
to the caller.

A

Returning functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The _________ can be any valid data type.

A

return_type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The _________ statement is optional. If not specified, the
function returns null.

A

return

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The return statement is optional. If not specified, the
function returns _________ .

A

null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The _________ of the value returned must match the return
type of the function.

A

data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A function can return at the most _________ value. In other
words, there can be only _________ return statement per function.

A

one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

_________ are a mechanism to pass values to functions.

A

Parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

_________ form a part of the function’s signature.

A

Parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The _________ values are passed to the function during its invocation.

A

parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_________ is a programming language model in which programs are organized around data, or objects, rather than functions and logic.

A

Object-oriented programming (OOP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

An object is an _________ meant to represent a component of a program.

A

abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

_________ can be created, destroyed, given attributes, and made
to perform actions.

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Every object belongs to a _________.

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The class of an object is its _________.

A

type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Objects of the same class have the same ________ variables and methods available to them

A

instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

a _________ is a blueprint for creating objects (a particular data structure), providing initial values for state (member variables or attributes), and implementations of behavior (member functions or methods).

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Use the _________ keyword to declare a class in Dart.

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

A class definition starts with the keyword class followed by the _________

A

class name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

the class body enclosed by a pair of _________.

A

curly braces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

A _________ is any variable declared in a class. They represent data
pertaining to objects.

A

field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Allows the program to initialize and retrieve the values of
the fields of a class.

A

Setters and Getters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

A _________ getter/ setter is associated with every class. However, they can be overridden by explicitly defining a setter/getter.

A

default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

responsible for allocating memory for the objects of the class.

A

Constructors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

represent actions an object can take.

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Functions are also at times referred to as _________.

A

methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

To create an instance of the class, use the _________ keyword followed by the class name.

A

new

33
Q

The _________ keyword is responsible for instantiation.

A

new

34
Q

The constructor should be passed _________ if it is parameterized.

A

values

35
Q

is a special function of the class that is responsible for initializing the variables of the class.

A

constructor

36
Q

Dart defines a constructor with the same name as that of the _________.

A

class

37
Q

A constructor is a function and hence can be _________

A

parameterized

38
Q

unlike a function, constructors cannot have a _________

A

return type

39
Q

If you don’t declare a constructor, a default _________ is provided for you.

A

no-argument constructor

40
Q

Dart provides _________ to enable a class define multiple constructors.

A

named constructors

41
Q

Dart provides named constructors to enable a class define _________.

A

multiple constructors

42
Q

_________ and _________, also called as accessors and mutators

A

Getters and Setters

43
Q

Getters and Setters, also called as _________ and _________

A

accessors and mutators

44
Q

_________ allow the program to initialize and retrieve the values of class fields respectively

A

Getters and Setters

45
Q

Getters or accessors are defined using the _________ keyword.

A

get

46
Q

Setters or mutators are defined using the _________ keyword.

A

set

47
Q

The _________ keyword refers to the current instance of the class in a method or constructor with parameters

A

this

48
Q

Fundamental Principles of OOP

A

Inheritance
Polymorphism
Abstraction
Encapsulation

49
Q

inherit members from parent class

A

Inheritance

50
Q

Access class through parents interface

A

Polymorphism

51
Q

Define and execute abstract actions

A

Abstraction

52
Q

Hide internal properties of the class

A

Encapsulation

53
Q

The class giving its members its child class

A

Base (parent) class

54
Q

The class taking members from its base class

A

Derived (child) class

55
Q

Inheritance implicitly takes __________ from another class

A

all members

56
Q

In Inheritance, some members may be __________ : private members hidden in the derived class

A

inaccessible

57
Q

Use __________ for building is-a relationship
* i.e: Dog is-a animal

A

inheritance

58
Q

Inheritance allows __________ to inherit the characteristics of an existing parent class (base)

A

child classes (derived)

59
Q

Inheritance allows child classes (derived) to inherit the
characteristics of an existing __________

A

parent class (base)

60
Q

A __________ can extend the parent class

A

child class

61
Q

An __________ defines set of operations(methods) that a given should support

A

interface

62
Q

A class can implement an __________ by providing implementation for all methods

A

interface

63
Q

Types of inheritance

A

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

64
Q

when a class inherits a single parent class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Single inheritance

65
Q

When a class inherits more than one parent class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Multiple inheritance

66
Q

when a class inherits another child class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Multi-level inheritance

67
Q

More than one class having the same parent class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Hierarchical inheritance

68
Q

Child classes inherits all properties and methods excepts __________ of the parent class

A

constructors

69
Q

Unlike Java, Dart does not support __________ inheritance

A

multiple

70
Q

Every class can at the most extend from one parent class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Single inheritance

71
Q

A class can inherit properties of the base class from another child class.

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Multi-level inheritance

72
Q

More than one classes have the same parent class

Single inheritance
Multiple inheritance
Multi-level inheritance
Hierarchical inheritance

A

Hierarchical inheritance

73
Q

A __________ type of inheritance only that inherits properties of parent class only that it overrides the same method declared in child class

A

Multi-level

74
Q

provide means ignoring irrelevant features, properties, or functions and emphasizing on relevant ones

A

Abstractions

75
Q

Abstractions helps manage complexity (T/F)

A

T

76
Q

Hides implementation details

A

Encapsulation

77
Q

Class announces only a few operations (methods) available to objects

A

Encapsulation

78
Q

All data members(fields) of the class are hidden and can only be accessed via properties (read-only and read-write)

A

Encapsulation