constants (const): The value of const is set at compile time(the value must be set when you declare it) and cannot be changed at run time.
ReadOnly : They need not be initialized when declared ,but must be initialized in constructor. They could be initialized else where other than constructor.
- const are themselves static, so you cannot declare
public static const int s =1 --Error cannot be static
2 .const can be used only with primitive types(exception is Strings) .i.e it does not make sense to use custom class with const.
public cosnt myclass = new myclass() ---Error must be a compile time value
.
Its possible for you to do that with ReadOnly.