What is static and use of it?



What is static and use of it?..

Answer / Priyal Gupta

In C#, the 'static' keyword is used to declare variables or methods that are shared among all instances of a class. Static members can be accessed without creating an instance of the class and are typically used for properties that should not vary between objects, such as constants or utility functions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can int be null c#?

1 Answers  


How many types of constructors are there?

1 Answers  


How do you generate documentation from the C# file commented properly with a command-line compiler?

1 Answers  


How many types of serialization are there in c#?

1 Answers  


Are objects passed by reference in c#?

1 Answers  


Does c# do array bounds checking?

1 Answers  


Explain async and await?

2 Answers  


What are the 3 logical operators?

1 Answers  


What is a string? What are the properties of a string class?

1 Answers  


How do you restrict the type which can be used in custom generic?

1 Answers   IBM,


How do I format a string in c#?

1 Answers  


Is exe is machine dependent?

1 Answers  


Categories