2
Reply

Tell me Guys.. Can Object will be Constant or Readonly....?

Amit Tiwari

Amit Tiwari

11y
1.3k
0
Reply

    ConstantsConstants are static by default They must have a value at compilation-time (you can have e.g. 3.14 * 2, but cannot call methods) Could be declared within functions Are copied into every assembly that uses them (every assembly gets a local copy of values) Can be used in attributes Readonly instance fieldsMust have set value, by the time constructor exits Are evaluated when instance is created

    objects can only be readonly.