---
title: "How to use property in c#"  
description: "How to use property in c#"  
author: "Anonymous User"  
published: 2016-01-20  
updated: 2016-01-20  
canonical: https://www.mindstick.com/forum/33903/how-to-use-property-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to use property in c#

I want to use [property in c#](https://www.mindstick.com/forum/160713/how-to-sort-object-arrays-by-specific-property-in-c-sharp) how to do this please help me.

## Replies

### Reply by Anonymous User

A [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) is a data member. in a class have multiple data members. which is easily access by class object. we can get and set a value of property.

```
using System;namespace tutorialspoint{    class Moters    {        private string engineno = "ADHG54578JAS";        private string _modelname = "maruti suzuki swift";          public string EngineNo        {            get            {                return engineno;            }            set            {                engineno = value;            }        }               public string ModelName        {            get            {                return _modelname;            }            set            {                _modelname = value;            }        }              public override string ToString()        {            return "EngineNo = " + EngineNo + ", ModelName = " + ModelName ;        }    }    class Example    {        public static void Main()        {            Moters m = new Moters();                     m.EngineNo = "2164DGAHSGD";            m.ModelName = "safari storme ";            Console.WriteLine("motors info: {0}", m);             Console.WriteLine("motors info: {0}", m);            Console.ReadKey();        }    }}
```

![How to use property in c#](https://www.mindstick.com/mindstickforums/5edb576d-a914-4e36-842c-e1936db43003/images/01ab259f-a1cf-4b5f-a101-fef3159cd78d.png)


---

Original Source: https://www.mindstick.com/forum/33903/how-to-use-property-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
