How works this code? Why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How works this code? Why?

{ int a; int b=15; a=(int)b+20; Console.WriteLine(b); } catch(Exception ex) { Console. Write(ex); }

11th Oct 2017, 6:34 PM
Валерия
Валерия - avatar
1 Answer
+ 1
b = 15 it is only assigned once a = 35 , (int) is a useless cast the try catch is the to confuse you
11th Oct 2017, 8:45 PM
sneeze
sneeze - avatar