Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Six of one, half a dozen of the other.
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01117331
Message ID:
01117783
Views:
15
Hi Einar,

In the context of the examples you gave, yes, they are the same.

The only condition that makes the two uses of the throw statement different is that a throw statement with no exception can be used only in a catch block. For example, you can throw a concrete instance of an exception without a try/catch block:
public static void Main()
{
	throw new Exception();
}
But you can't do this:
public static void Main()
{
	throw; // this will cause a compilation error
}
This will cause a compilation error saying that a throw statement with no arguments is not allowed outside a catch block.

Regards,
-----
Fabio Vazquez
http://www.fabiovazquez.com
Previous
Reply
Map
View

Click here to load this message in the networking platform