What dos this syntax mean: Default = f.@default == "yes"

Posted on 2011-10-09
Last Modified: 2012-05-12
Default is a boolean but I am confused by the @ in front of "default".

Is that just the variable name?

It follows this line:

Question by:newbieweb
    LVL 51

    Expert Comment

    Default = f.@default == "yes"


    Default = (f.@default == "yes")


    if (f.@default == "yes") then Default = true else Default=false

    Author Comment

    Yes, I understand C#.

    I was asking about the @ in front of default.
    LVL 7

    Assisted Solution

    It allows you to use a reserved word.  E.g., the following won't compile:

    int default = 1;
    LVL 40

    Accepted Solution

    default is a reserved word in C#.

    Adding @ in front of a property or method name enables you to use a word that would not be usable otherwise.

    Having a property called default is not permitted, because it is a reserved word, but @default is accepted.

    Search for "C# Keywords" in the documentation and give a look at the first paragraph.

    Author Closing Comment

    Thanks. I now remember I used to know that :)

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    vSphere client error 503 5 56
    Visual Studio 2013 Publish 13 30
    Jquery oncheck to update SPAN 31 34
    The Using statement in C# 5 12
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now