Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Six of one, half a dozen of the other.
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01117331
Message ID:
01117783
Vues:
16
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform