GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#
Go To First  |  Previous Question  |  Next Question 
 C#  |  Question 6 of 431    Print  

Why do I get a syntax error when trying to declare a variable called checked?

The word checked is a keyword in C#.


  
Total Answers and Comments: 3 Last Update: April 05, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Vikas Yadav
 
Reason is checked is a keyword in C#,but if u want to keyword as an identifier use @ with it.e.g int @checked=3;
This works with all the keywords,but it is recommended to avoid it.

Above answer was rated as good by the following members:
velsankar
January 09, 2006 09:25:07   #1  
sahu Member Since: December 2005   Contribution: 324    

RE: Why do I...

Ans:

Yes,

The word checked is a keyword in C#.


 
Is this answer useful? Yes | No
October 04, 2007 00:35:48   #2  
cmakarla Member Since: October 2007   Contribution: 1    

RE: Why do I...
Checked and UnChecked is keyword in C# used to control the overflow-checking contex for integral type arithemetic operations and conversions. it can be used as an operator or a statement.
 

 
Is this answer useful? Yes | No
April 05, 2008 03:49:33   #3  
Vikas Yadav Member Since: April 2008   Contribution: 15    

RE: Why do I get a syntax error when trying to declare a variable called checked?
Reason is checked is a keyword in C#,but if u want to keyword as an identifier use @ with it.e.g int @checked=3;
This works with all the keywords,but it is recommended to avoid it.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape