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: 
Create a Language object in the constructor

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

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

    public string LanguageCode
    {  
     get
        {
            string language = l.Name;
            return language;
        }

    }
}

```
This is not really a good practice, in my opinion, since every time you get the property - the new object is instantiated. 

I would create a private property and store the actual string in it:

```
public class Company : Entity  
{   
    private string _languageCode 
    public string LanguageCode
     {  
         get
         {
            if (String.IsNullOrEmpty(_languageCode) 
            {
               Language l = new Language();              
               _languageCode = l.Name;
            }
            return _languageCode
         }
     }
}

```

That way the `Language` object will only be created once the property accessed the first time.