Readonly vs. const?

Answer Posted / pavan

both of them does the same work these value cannot be
changed
but with a samll difference
using const we can assign a value before compile time
but using readonly we can assign value to the varible ones
in runtime

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does cil do?

580


What is meant by globalization?

577


Explain what is the difference between a class and an object?

610


What is the advantage of .net core?

556


How ccw (com callable wrapper) and rcw (runtime callable wrappers) works?

582






What is the difference between response.redirect & server.transfer?

559


Tell us what is a sealed class?

562


what are connection strings?

1755


Explain how viewstate is being formed and how it's stored on client in .net?

552


What are data types in .NET?

663


What is COM Interoperability in .NET

647


Explain about .net assemblies?

618


What is meant by localization?

645


What is close method? How its different from finalize and dispose?

531


What is .net core used for?

560