I erroneously wrote the following crap in my -block:
The correct way to write it is
Of course, the compiler complained about my code, but I found it interesting, how it complained:
The error message says, that the symbol e was not found. How come? Of course, e is a known symbol here (and if I replace the incorrect class by the correct getClass(), I don't get a compiler error anymore.
My explanation may not be the best so I give it a try.
When you use ".class" (with the dot) the compiler/JVM is really looking for that class file/bytecode.
So in your case, the compiler is looking for the class called "e" in your project or Java API, which there isn't one. "e" is a variable, the compiler doesn't know you are referring to the "Exception.class" if you do "e.class".
Therefore using "e.getClass()" will resolve that to the Exception.class