Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
var in class level members
Prakash Tripathi
Jul 3 2016 2:45 AM
402
Reply
Hello experts,
I wonder why var is not allowed to be used in class level members. When using so, I am getting error as "
The contextual keyword 'var' may only appear within a local variable declaration or in script code
"
class ConcurrentDictionaryDemo
{
var phoneOrders = new ConcurrentDictionary<string, int>(); //Error
............
............
}
Any thoughts on this?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
C# Polygon Border Algorithm
How to Download in in file