Question #19194

Which of the following C# code lines is valid?
byte x = 2.0;
byte x = (2 + 3);
byte x = (byte)(2.0 + 3);
byte x = (byte)(10 - 11);

Expert's answer

byte x = (byte)(10 - 11);
LATEST TUTORIALS
APPROVED BY CLIENTS