Quantcast
Viewing all articles
Browse latest Browse all 6

What is Object type!!!

Hi,

What HanneSTheEGreaT (but difficult to type) was getting at is when you treat things as objects you can't treat them as specific things but general things. Example if you pass an Employee as an Object then you lose the methods of the Employee, you cannot call .Fire() or .GiveHugeMassiveKiss() on the Employee.

The methods aren't lost but you have to cast the general object of type Object to a more specific Employee object before you can use it. This is called casting. Cast to an Employee. This isn't recommended and so you shouldn't really use parameters of type Objects, just not worth it.

Boxing and Unboxing is a term that sort of decribes this. Kind of as it includes another dicussion about something called value types and reference types.
www.dsmyth.net | www.dsmyth.net/wiki

Viewing all articles
Browse latest Browse all 6

Trending Articles