This is a .NET question for C# (or possibly VB.net), but I am trying to figure out what\'s the difference between the following declarations:
string hello =
An '@' has another meaning as well: putting it in front of a variable declaration allows you to use reserved keywords as variable names.
For example:
string @class = "something";
int @object = 1;
I've only found one or two legitimate uses for this. Mainly in ASP.NET MVC when you want to do something like this:
<%= Html.ActionLink("Text", "Action", "Controller", null, new { @class = "some_css_class" })%>
Which would produce an HTML link like:
Text
Otherwise you would have to use 'Class', which isn't a reserved keyword but the uppercase 'C' does not follow HTML standards and just doesn't look right.