Question: I have a class `Company`.

Inside my class i want to declare a string `LanguageCode` which gets is value from another class `Language`.

Like this:

```
public class Company : Entity  
{    
    public string LanguageCode
     {  
         get
         {
            Language l = new Language();              
            string language = l.Name;
            return language;
         }
         set { ;}
     }
}

```

When running I am not getting any error but is it correct way to create a new instance of a class in get {};

Answer: 
Your solution is not very wise. Every time, you call getter, you will get new instance of Language. I believe, that you should declare language instance inside your class.

```
class Company : Entity 
{
   private Language l;

    public Company()
    {
        this.l = new Language();  
    }

   public string LanguageCode
     {  
         get
         {            
            return this.l.Name;
         }         
     }

}

```
To start, as others have already suggested, if your set is empty then you are better off removing it to make the property clearly read-only.

Then, while it is formally correct, I do not see the logic in this getter. A new class is instantiated every time, and the return value is always the same.

If you just need to return the string with the Language name, you can declare a private property languageCode, initialize it in the constructor and then expose it with a public getter, like this:

```
public class Company : Entity  
{   
    private Language languageCode;

    public Company
    {
        languegeCode = new Language();
    }

    public string LanguageCode
    {  
        get
        {
            return languageCode.Name;
        }
    }
}

```