Reputation: 17556
This is something , i don't understand , if i put any arbitrary string inside a code block, it will throw some compile time error but if i put something like below , it will not.
static void Main(string[] args)
{
int i = 5;
ghfhfghfghfghfhfghfhfghfghfghfhfghfghfghghttp://www.google.com
Console.WriteLine(i.ToString());
Console.ReadLine();
}
any idea why this is happening? I just found it accidentally , not sure why , may be i am missing something.
Upvotes: 1
Views: 67
Reputation: 73482
That is a Label.
Look at the :
at the end.
If you remove the :
in the end. It won't compile
Upvotes: 6
Reputation: 125630
ghfhfghfghfghfhfghfhfghfghfghfhfghfghfghghttp:
is a label, because it's followed by :
.
You can then use it with goto
statement:
static void Main(string[] args)
{
int i = 5;
ghfhfghfghfghfhfghfhfghfghfghfhfghfghfghghttp://www.google.com
Console.WriteLine(i.ToString());
Console.ReadLine();
goto ghfhfghfghfghfhfghfhfghfghfghfhfghfghfghghttp;
}
Upvotes: 4