Hi there, ladies and gents.

I am still in the full throws of learning C# and OOP; however, I'm not actively using it on a day-to-day basis, so my knowledge is based on books rather than real-world programming.

I have a concept I feel I understand (I hope) - casting - but I wanted to reaffirm my understanding with you experienced C#/OOP programmers to make sure I am on the right track. I'd be very grateful if I could get your input.

Please forgive my explanation; I hope it is easy to understand.

Question 1:

Consider the following statement:

Code:
Object Obj = new Employee();
As I understand it, the above statement declares a reference variable of type Object, which is assigned a memory address pointing to an Employee object created by the new keyword. Am I correct in thinking that the the Obj reference variable cannot see the implementation details of the Employee object, only those defined by Object?

Questions 2:

Consider the following statement:

Code:
Employee emp = Obj;
Am I correct in thinking that the above statement would cause an invalid casting exception error given this attempted implicit cast?

And to rectify this, I'd need to perform an explicit cast?

Code:
Employee emp = (Employee)Obj;
Does the above cast cause both reference variables emp and Obj to point to the same object? Would their 'view' of the object differ based on their declared types?

Given the explicit cast, can emp now see the full interface details defined in the Employee class?

Many thanks in advance for your help,