Ch. 9 Flashcards

(20 cards)

1
Q

Which of the following statements about LINQ is false?

A new LINQ query must be used when changes are made to the data source.

A LINQ query does not need to have a let clause

A LINQ query returns an IEnumerable object

LINQ stands for Language Integrated Query.

A

A new LINQ query must be used when changes are made to the data source.

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

A generic method does not need an object of the class in order to execute.
True.
False.

A

False

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

The .NET collection classes provide flexible, efficient alternatives to arrays.
True.
False.

A

True

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

The international standard for querying relational databases is called:
XML
SQL
HTTP
LINQ

A

SQL

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

You can sort a LINQ query’s results only by one property.
True.
False.

A

False

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

Elements can be added at any location within an array after it’s created.
True.
False.

A

False

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

A List<T> can automatically resize itself to accommodate additional elements.
True.
False.</T>

A

True

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

The ________ extension method is typically used to determine whether a LINQ query’s results are non-empty.
Any
First
Count
None of the above

A

Any

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

A LINQ query is executed when it’s created.
True.
False.

A

False

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

You can sort a LINQ query’s results only by one property.
True.
False.

A

False

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

The Capacity property indicates the number of elements stored in the List<T>.
True.
False.</T>

A

False

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

Collections of type List<T> can hold objects of what type?
only other lists
only integers
objects of any one type
None of the above</T>

A

objects of any one type

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

Unlike arrays, lists do not resize automatically.
True.
False.

A

False

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

The results of a LINQ query can have only the same type as the data being queried-for example, a LINQ query on a collection of Employee objects will always have Employee objects in the results.
True.
False.

A

False

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

The range variable is implicitly defined in the _____ clause and used to produce results in the ______ clause
where, put
from, put
from, select
where, select
in, foreach

A

from, select

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

The ________ extension method is returns the number of results in a LINQ query.
Any
First
Count
None of the above

17
Q

You can sort a LINQ query’s results only by one property.
True.
False.

18
Q

The objects returned when using multiple properties in a select clause are objects of an anonymous type.
True.
False.

19
Q

LINQ is used to query collections in the same way it’s used to query arrays.
True.
False.

20
Q

A let clause is used to create _______.
a method within a LINQ query
a subquery
a new range variable
None of the above

A

a new range variable