Skip to main content
2 of 2
Minor edit: grammar/spelling/case/punctation/etc.
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Other underused operators are checked and unchecked:

short x = 32767; // 32767 is the max value for short short y = 32767; int z1 = checked((short)(x + y)); //will throw an OverflowException int z2 = unchecked((short)(x + y)); // will return -2 int z3 = (short)(x + y); // will return -2 
Binoj Antony
  • 16.3k
  • 25
  • 92
  • 98