Field-based properties
Freya already supports field-based properties. If you declare a property, but you don't provide an implementation, the compiler adds automatically a hidden field and implements the property using the new field. Even if the property is declared as read only, you can assign values to the hidden field using the property name, as long as your code is located inside the declaring class or inside another class nested in the declaring class.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7ViUwwDBhKFj4kFDlJAwn5RZrj70x2pkxw2QMlGLTcVIfjODQhoilRLzwtb9qZXXE8fvsXFkt3O9pN5xFSmKFmEaEoNicE_UhHAaPZOCJUAEOseWLK2T_AR0837GVIlH1O5Vt/s320/fields.jpg)
Labels: field, optimization, property
0 Comments:
Post a Comment
<< Home