What is the correct syntax to define a C# constant?

24. What is the correct syntax to define a C# constant?

  1. const type constant_name;
  2. const type constant_name = value;
  3. const constant_name as type;
  4. const constant_name as type = value;

Answer: B) const type constant_name = value;

Explanation:

The correct syntax to define a C# constant is:

const type constant_name = value;

Note: A const field requires a value to be provided.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.