try-catch Exception | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

try-catch Exception

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

21st Jun 2019, 8:35 AM
3 Answers
+ 3
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.
21st Jun 2019, 8:45 AM
Rincewind - avatar
+ 3
e is just a variable name. Exception e String str char c Object o ...
21st Jun 2019, 9:47 AM
Denise Roßberg
Denise Roßberg - avatar
+ 1
parameter name
21st Jun 2019, 9:52 AM