Constant & ReadOnly

Difference between Constant & Read only: by Sagar Jaybhay

Constant – are compile-time constant and not assign a static keyword to constant and also accessible in static method.

Value is set when the declaration performed means at the time declaration you can’t declare blank or null and then assign value is not possible.

When to use?

  • Data is absolutely constant then and then you can use constantly when values are absolutely constant.

Read-only- Is runtime constant means value is assigned at run time in the constructor only you can’t be assigned value in the methods.

  • When you want to decide at first runtime and then through-out the program it remains constant.
  • After the first time initialization, you can’t change value.

Sagar Jaybhay, from Maharashtra, India, is currently a Senior Software Developer at Software Company. He has continuously grown in the roles that he has held in the more than seven years he has been with this company. Sagar Jaybhay is an excellent team member and prides himself on his work contributions to his team and company as a whole.

Sagar Jaybhay

Sagar Jaybhay, from Maharashtra, India, is currently a Senior Software Developer at Software Company. He has continuously grown in the roles that he has held in the more than seven years he has been with this company. Sagar Jaybhay is an excellent team member and prides himself on his work contributions to his team and company as a whole.

You may also like...

1 Response

  1. Shad says:

    I hope to give something back and help others like
    you helped me. https://mauss.ca

Leave a Reply

Your email address will not be published. Required fields are marked *