Explain the difference between public and static modifiers?
Answer / Ashish Nag
In .NET, both Public and Static are access modifiers but they behave differently:nn- Public: It allows any part of the code (including other classes) to access a member. This is the default access level for members.n- Static: It indicates that a member belongs to a type rather than an instance of the type. Static members are shared among all instances and can be accessed without creating an instance.nnFor example:n```csharpnpublic class MyClass {n public int myField; // Public, per-instance fieldn static public void MyStaticMethod() { }n}nMyClass c1 = new MyClass();nc1.myField = 5;nMyClass.MyStaticMethod();n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain garbage collection?
What are virtual destructures?
What is Ajax? How it is related to your project?
What is the difference between Server.Transfer and Response.Redirect?
What is the use of ErrorProvider Control in .NET?
Explain what do the terms “boxing” and “unboxing” mean?
What is .net standard?
Explain the difference between the while and for loop.
What is a formatter in .net?
Will it go to finally block if there is no exception happened?
How viewstate is being formed and how it's stored on client in .net?
What is meant by .Net framework?