InterviewSolution
Saved Bookmarks
| 1. |
Differentiate between static and public? |
|
Answer» The public access modifier in C# states the compiler that the element is accessible by any other element in the same or other class. When a member in C# has the Static access modifier in front of it, such as static method, static variable, or static parameters, it means that the element has global access and any other element can access it using class directly. You don't need to create an instance of the class to access that element. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created. |
|