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

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

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 159
  • Karma: 0
    • Hot Shaper
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 44
  • Posts: 893
  • 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
9433 Views
Last post 09-24-2016, 03:38:52
by Tabslogic
8 Replies
3653 Views
Last post 08-06-2016, 05:31:35
by emodafinil
16 Replies
6385 Views
Last post 07-25-2016, 01:26:41
by Bhuwan
2 Replies
1657 Views
Last post 03-20-2016, 21:14:10
by Joey.Jr
0 Replies
457 Views
Last post 02-15-2016, 03:56:44
by chinmay.sahoo