---
title: "Shadowing in C# using new keyword"  
description: "Shadowing in C# using new keyword"  
author: "Norman Reedus"  
published: 2016-03-25  
updated: 2016-03-25  
canonical: https://www.mindstick.com/forum/34077/shadowing-in-c-sharp-using-new-keyword  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Shadowing in C# using new keyword

We want to use Shadowing in C#. How to use this please help me.

## Replies

### Reply by Anonymous User

Shadowing is concept to hide functionality provided by base class member. We can also change return type of member also. In overriding we can only change definition but in shadowing we can change return type also

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Shadowing
{
    class Program
    {
        static void Main(string[] args)
        {
            ChildClass obj = new ChildClass();
            obj.GetInvoice();
            Console.ReadLine();
        }
    }
    public class BaseClass {
        public int InvoiceNumber = 10;
        public virtual void GetInvoice()
        {
            Console.WriteLine("This is Base Class Data");
        }
    }
    public class ChildClass:BaseClass
    {
        public new string InvoiceNumber = "10";
        public new string GetInvoice()
        {
            Console.WriteLine("This is Child Class Data");
            return string.Empty;
        }
    }
}
```

```

```


---

Original Source: https://www.mindstick.com/forum/34077/shadowing-in-c-sharp-using-new-keyword

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
