+ Start a Discussion
Sourav PSourav P 

Casting a Data Type "Object" to a custom class type ?

Hi,
Can anybody explain in simpler term, what exactly a data type " Object" in apex and what it mean to cast an object to a custome class ?

In below example, why not we can use as below ? ,
obj. someClassMethod ();
what is the need of the below,
MyApexClass mc = (MyApexClass)obj;

User-added image

 
Nand AroraNand Arora
You can refer to this link (https://salesforce.stackexchange.com/questions/42594/object-class-in-apex) for a decent explanation.