

This is incorrect. The C# is valid. Throw in a catch statement simply rethrows the caught exception. Source: I’ve been writing C# for 20 years, also the docs.
I won’t act like MS absolutely didn’t steal core concepts and syntax from Java, but I’ve always thought C# was much more thoughtfully designed. Anders Hejlsberg is a good language designer, TypeScript is also a really excellent language.
Wildly, in C# you can do either and it has different results. I believe a bare
throw
doesn’t append to the stack trace, it keeps the original trace intact, whilethrow e
updates the stack trace (stored on the exception object) with the catch and rethrow.In C#, you can only throw objects whose class derives from Exception.