Qus:    What is difference between constants and read-only?
Dec 24, 2020 14:07 2 Answers Views: 749 DIVYA
Prev Next
Answers (2)
PARTH Dec 26, 2020 04:54
Answer:   Constants have to be initialized during declaration only while readonly fields can be initialized at declaration or in the constructor.
Constants can be declared inside methods while readonly fields cannot be declared inside methods.

SHIVA Dec 29, 2020 08:08
Answer:   Constant variables are declared & initialized at compile time. The value can’t be changed afterwards. Read only is used wrhere the value can be changed during run time o when we want to assign the value at run time.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.

Let`s Connect