try-catch Exception | SoloLearn: Learn to code for FREE!


try-catch Exception

try{ some code… } catch(Exception e) { ……. } What does the alphabet "e" after the exception in the bracket mean?

6/21/2019 8:35:29 AM


3 Answers

New Answer


Its the same as other functions where, for example, you write int a to represent that the function takes an integer as the parameter but you don't know what it is yet so you represent it within the function with a. Here, you know the parameter type will be an Exception and you're representing it with an e.


e is just a variable name. Exception e String str char c Object o ...


parameter name