Select from following answers:- It can store any type of value but It is mandatory to initialize var types at the time of declaration.
- It is type safe i.e. Compiler has all information about the stored value, so that it doesn't cause any issue at run- time.
- Var type cannot be passed as method argument and method cannot return object type.
- Var type work in the scope where it defined and an implicit type.
- All Above

All statement are true about Var keyword.It is introduced in C# 3.0
For Example:-
var index = 0;//intialize at the time of declaration
var books = new List<int>{1,2,3,4,5};
var value = from v in books
where(v % 2 == 1)
select v;
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator