+ 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 Odpowiedź
+ 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