Skip to content

C# Interview Questions 2: Prep

David Smith

Asked Sep 16, 2015, 11:40 PM EDT1 answer
Share
LinkedInX

1.What statement do you use to access the name property via the indexers of the customers collection?

1.cutomers.[1].Name

2.cutomers.Item{1}.Name

3.cutomers.Item(1).Name

4.cutomers(1).Name

5.cutomers[1].Name

Which Option?

2.How do you use the postfix increment operator on a variable named i to increment the variable?

Code
1.i++;
2.++i;
3.i=i+1;
4.i=i++;
5.i=++i;

Which option?

3.You use generics to keep elements of a collection in their original type, so you:

1.need more unboxing operations.

2.do not need boxing operations, but need unboxing operations.

3.need more boxing operations.

4.do not need boxing or unboxing operations.

5.need boxing operations, but do not need unboxing operations

Which Option

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Minhaj Hussain
    0
    Question 1:   5.cutomers[1].Name
    Question 2:   1.i++;
    Question 3:  4.do not need boxing or unboxing operations. 
    0