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 are the differences between an interface and an abstract class in .net?

514


Is .net an object oriented language? What are their components?

525


What's typical about a windows process in regards to memory allocation in .net?

577


What is garbage collection and how it works ?

581


What is an exe and a dll?

598






Explain what relationship is between a process, application domain, and application?

617


What is Complex Class in .NET?

603


Who is using .net core?

538


What is the advantage of .net?

537


Is .net a language?

562


What is the need of OLE-automation?

635


Why do we use the “using” statement?

536


What is your observations between vb.net and vc#.net?

539


What is Ajax? How it is related to your project?

622


What is an anonymous method?

527