Question: I'm just wondering if it is possible..

I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.

Is there any way to rename the Level variable in the derived class?

**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, and especially to classes (Which our teacher doesn't teach us for some reason)

Answer: 
The closest you could get with inheritance would be:

```
class BaseClass
{
  protected int Level { get; set; }
}

class SubClass : BaseClass
{
  public int Points { get { return Level; } set { Level = value; } }
}

```

But that doesn't actually *expose* BaseClass.Level, since a protected property is only visible to subclasses.

As @Jason explains, a subclass can't obscure the public interface of its base class. If you really wanted to do that, you could *encapsulate* the base in a new object that exposes its properties:

```
class A
{
   public Foo { get; set; }
   public Bar { get; set; }
   public Level { get; set;}
}

class B
{
  private A _internalA;

  public Foo { get { return _internalA.Foo; }  set { _internalA.Foo = value; } }
  public Bar { get { return _internalA.Bar; }  set { _internalA.Bar= value; } }
  public Points { get { return _internalA.Level; }  set { _internalA.Level = value; } }
}

```

This is typically referred to as *composition*: B is composed of A, rather than inheriting from it.
> 
> Is there any way to rename the Level variable in the derived class?
> 
> 
> 

No, stop and think about why for a second. If you have an instance of `Base`, you could refer to the property `Level`. Now if you have an instance of `Derived`, it is also a `Base`, and therefore it should have property named `Level`. It's that simple: a `Derived` is also a `Base` so whatever you can do with `Base` you should be able to do with `Derived`.

But, you could do this:

```
class Base {
    protected int Level { get; set; }
}

class Derived : Base {
    public int Points { get { return this.Level; } set { this.Level = value; } }
}

```

Note that `Level` is no longer publicly visible.