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

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

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 153
  • Karma: 0
    • No Addiction
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 17
  • Posts: 897
  • 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
26 Replies
8580 Views
Last post 09-24-2016, 03:38:52
by Tabslogic
9 Replies
3349 Views
Last post 08-06-2016, 05:31:35
by emodafinil
18 Replies
5758 Views
Last post 07-25-2016, 01:26:41
by Bhuwan
4 Replies
1425 Views
Last post 03-20-2016, 21:14:10
by hap53144
0 Replies
359 Views
Last post 02-15-2016, 03:56:44
by chinmay.sahoo