Question:Static vs Non static members. 

Answer 1. static members are one per class but non-static members are one per instance. 2. static members are accessed by their class name which encapsulates them, but non-static members are accessed by object reference. 3. static members can't use non-static methods without instantiating an object, but non-static members can use static members directly. 4. static constructor is used to initialize static fields, but for non-static fields normal instance constructor is used. 

+ Report
Total Preview: 924
Static vs Non static members.
Copyright © 2024. Powered by Intellect Software Ltd