What is the difference between const and static read-only?

Author Topic: What is the difference between const and static read-only?  (Read 771 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
The major difference is that static variable can be modified by the class which contains it whereas a variable declared const cannot be changed.


Offline TomClarke

  • Trade Count: (0)
  • Hero Member
  • *****
  • Thank You 52
  • Posts: 868
  • Karma: 0
  • Gender: Male
    • Custom Writing Service & Content Marketplace
Re: What is the difference between const and static read-only?
« Reply #1 on: 04-19-2016, 05:58:32 »
Constant and readonly keyword are used to make a field constant which value cannot be modified. Static keyword is used to make members static that can be shared by all the class objects. 
Your ideas, our writings - Writology.com

 

Related Topics

  Subject / Started by Replies Last post
25 Replies
11574 Views
Last post 09-24-2016, 03:38:52
by Tabslogic
8 Replies
4572 Views
Last post 08-06-2016, 05:31:35
by emodafinil
15 Replies
8138 Views
Last post 07-25-2016, 01:26:41
by Bhuwan
7 Replies
5804 Views
Last post 09-18-2018, 17:12:58
by tecy0123merry
1 Replies
404 Views
Last post 09-23-2017, 01:08:33
by Hitesh Patel