+ 2

how is this possible ?

Task.run(()=> { try { statement; } catch(exception ex){} Console.write("Hi"); } is there any chance that when any exception will occur it will not print....because i was doing exactly the same..in the statement i was aborting some other thread..but whenever any exception occurs It doesn't print the Hi message....why?

21st Jan 2018, 2:39 PM
Somnath Ghosh
Somnath Ghosh - avatar
2 Answers
+ 8
@Somnath, I could be wrong, but isn't the Console.Write supposed to be wrapped inside the catch's curly braces if we want to print "Hi" on exception? Btw, you know this is C#, tell me why did you mix your tags with Python and Java?
21st Jan 2018, 3:07 PM
Ipang
+ 1
No...it should be after catch...i tagged python,java just to reach maximum people as many of them know 2-3 language but they give suggestion on their current language.
21st Jan 2018, 4:05 PM
Somnath Ghosh
Somnath Ghosh - avatar