MCQs > IT & Programming > C# > What is the difference between const and readonly?

C# MCQs

What is the difference between const and readonly?

Answer

Correct Answer: A const is a compile-time constant whereas read-only allows a value to be calculated at run-time and set in the constructor or field initializer. So, a 'const' is always constant but 'read-only' is read-only once it is assigned.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it