ask if a class inherits from another

  • Thread starter Thread starter Rodolfo
  • Start date Start date
R

Rodolfo

I need to do something like this

public class a : b{
....

}
....
a objecta = new a();

if (objecta "inheritsfrom" b)
do something;

There's a reserved word to do that?

TIA
 
Rodolfo said:
I need to do something like this

public class a : b{
...

}
...
a objecta = new a();

if (objecta "inheritsfrom" b)
do something;

There's a reserved word to do that?

TIA
if(objecta is b)// I think
or
b B = objecta as b;
if(!B is null)
//objecta inherits from b

HTH
JB
 
Back
Top