What is the difference b/w Readonly Variable and Constant
Variable?

Answer Posted / nishant vishwakarma

A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for runtime constants

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the class that allows an element to be accessed using unique key?

738


What is meant by jagged arrays?

758


Explain about the keyword must inherit?

755


What is datatype conversion?

734


What is difference between import system.data.sqlclient,system.data.oledb?

759


What is visual basic.net culture?

717


How to store images in sql server database through vb.net?

701


Name the two main parts of .net?

698


Explain global assembly cache (gac)?

916


What is the use of assembly?

749


How does vb.net achieve polymorphism?

715


How a base class method is hidden?

805


What is late binding and early binding?

758


Which class allows an element to be accessed using unique key?

702


Explain jit?

729