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

Author Topic: What is the difference between const and static read-only?  (Read 1000 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 55
  • Posts: 837
  • 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
14827 Views
Last post 09-24-2016, 03:38:52
by Tabslogic
25 Replies
8818 Views
Last post 02-24-2013, 07:51:38
by gilbertholdings
8 Replies
5522 Views
Last post 08-06-2016, 05:31:35
by emodafinil
0 Replies
867 Views
Last post 02-15-2016, 03:56:44
by chinmay.sahoo
1 Replies
750 Views
Last post 09-23-2017, 01:08:33
by Hitesh Patel