---
title: "What is static keyword in c#?"  
description: "What is static keyword in c#?"  
author: "Pradeep kumar Patel"  
published: 2019-10-24  
updated: 2019-10-24  
canonical: https://answers.mindstick.com/qa/82410/what-is-static-keyword-in-c-sharp  
category: "programming language"  
tags: ["c#", ".net programming"]  
reading_time: 1 minute  

---

# What is static keyword in c#?

What is [static](https://www.mindstick.com/articles/12098/the-static-keyword-the-static-methods) [keyword](https://www.mindstick.com/blog/389/java-script-void-keyword) in c#?

## Answers

### Answer by Pradeep kumar Patel

The **static keyword** in c # is used to declare static class or static data members or static property. A static class can only contain static data members, static methods and static constructor. We can access those static data members directly with a class name instead of creating on object of a class to access those properties. Following is the example of defining a class with static properties and those can be access directly with a type instead of specific object name.

```
class User
{
public static string name, location;
public static int age;
}
```

\


---

Original Source: https://answers.mindstick.com/qa/82410/what-is-static-keyword-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
