Deck 9: Introduction to Linq and Generic Collections
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/27
Play
Full screen (f)
Deck 9: Introduction to Linq and Generic Collections
1
You can sort a LINQ query's results only by one property.
False
You can supply a comma-separated list of properties in the orderby clause.
You can supply a comma-separated list of properties in the orderby clause.
2
LINQ allows you to select from a data source items that meet a set of conditions.
True
3
A List< T > is similar to an array,but can also _________.
A) dynamically resize
B) add items anywhere in the List< T >
C) contain objects of any one type
D) Both a and b
A) dynamically resize
B) add items anywhere in the List< T >
C) contain objects of any one type
D) Both a and b
D
4
The ________ extension method is typically used to determine whether a LINQ query's results are non-empty.
A) Any
B) First
C) Count
D) None of the above
A) Any
B) First
C) Count
D) None of the above
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
5
What method returns the number of items in LINQ query result q
A) Length
B) Size
C) getUpperBound
D) Count
A) Length
B) Size
C) getUpperBound
D) Count
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
6
TheNET collection classes provide flexible,efficient alternatives to arrays.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
7
The international standard for querying relational databases is called:
A) XML
B) SQL
C) HTTP
D) LINQ
A) XML
B) SQL
C) HTTP
D) LINQ
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
8
Visual C# requires you to write SQL to query data sources.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
9
The range variable is implicitly defined in the _____ clause and used to produce results in the ______ clause
A) where, put
B) from, put
C) from, select
D) where, select
E) in, foreach
A) where, put
B) from, put
C) from, select
D) where, select
E) in, foreach
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
10
In a LINQ query,the where clause specifies .
A) the data source
B) where to put the data
C) the condition(s) for including the item
D) the Location property
D) the data type
A) the data source
B) where to put the data
C) the condition(s) for including the item
D) the Location property
D) the data type
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
11
The ________ extension method indicates that only unique values should be included in a LINQ query's results.
A) Any
B) Distinct
C) Count
D) None of the above
A) Any
B) Distinct
C) Count
D) None of the above
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
12
You can sort a LINQ query's results only by one property.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
13
Collections of type List< T > can hold objects of what type
A) only other lists
B) only integers
C) objects of any one type
D) None of the above
A) only other lists
B) only integers
C) objects of any one type
D) None of the above
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
14
The ________ extension method is returns the number of results in a LINQ query.
A) Any
B) First
C) Count
D) None of the above
A) Any
B) First
C) Count
D) None of the above
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
15
Unlike arrays,lists do not resize automatically.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
16
The objects returned when using multiple properties in a select clause are objects of an anonymous type.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
17
You can sort a LINQ query's results only by one property.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
18
If multiple properties are listed in the select clause,the results will be of type SelectedList.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
19
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.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
20
A generic method does not need an object of the class in order to execute.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
21
The Capacity property indicates the number of elements stored in the List< T >.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following statements about LINQ is false
A) A new LINQ query must be used when changes are made to the data source.
B) A LINQ query does not need to have a let clause
C) A LINQ query returns an IEnumerable object
D) LINQ stands for Language Integrated Query.
A) A new LINQ query must be used when changes are made to the data source.
B) A LINQ query does not need to have a let clause
C) A LINQ query returns an IEnumerable object
D) LINQ stands for Language Integrated Query.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
23
A let clause is used to create _______.
A) a method within a LINQ query
B) a subquery
C) a new range variable
D) None of the above
A) a method within a LINQ query
B) a subquery
C) a new range variable
D) None of the above
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
24
A List< T > can automatically resize itself to accommodate additional elements.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
25
LINQ is used to query collections in the same way it's used to query arrays.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
26
Elements can be added at any location within an array after it's created.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
27
A LINQ query is executed when it's created.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck