Multiple choice

Which of the following is the component of .NET Framework which makes it a Type-safe environment?

  1. CLR

  2. CTS

  3. MSIL

  4. Assembly Manifest

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

CTS ensures type compatibility between various .NET components as CTS stands for Common Type Safety. For e.g. int x = TextBox1.text; // considering the scenario that we have some value in the textbox1 which is of text type and we are receiving the value in int type. So, CTS would not allow you this type of conversion in .NET and this could be done by:

int x = Convert.ToInt32(TextBox1.Text);  // As we have done the typecasting of text type to int type. So, CTS would allow us to get the text type value to the int type variable.