Multiple choice technology web technology

Which one of the following statements is true about verifiably type-safe managed code?

  1. All .NET compilers produce only verifiably type-safe code.

  2. Visual Basic .NET and C# produce verifiably type-safe code if you avoid certain constructs.

  3. Only Visual C++ with Managed Extensions produces verifiably type-safe code.

  4. Visual C++ with Managed Extensions produces verifiably type-safe code if you avoid certain constructs.

  5. C++ and C# cannot produce verifiably type-safe code.

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

Verifiably type-safe code passes the CLR's verification without throwing exceptions. C# and VB.NET produce verifiably type-safe code if you avoid unsafe constructs like pointers. Visual C++ with Managed Extensions defaults to unsafe code but can produce verifiable code if you avoid certain constructs. Not all .NET languages produce verifiable code by default.