c# - best way to check class -


I have a method that is taking in the parameter that is the interface object

this way

  classode someVar = (ClassD) (ClassB)  

IUA)) D).

If everything else is fine and dandy though, in some cases the example of ClassZ can be an example instead of the object IUA ClassB, so to find out the above line errors in that situation, before making the above statement There is no way that the object really belongs to which class? If I know that before hand I can make a statement and do the following:

  classified avवे = = (class D) (((Class C) (Class IUA)). );  

I have come from Java background ... in Java I know that we have found () ... will be equal in the net?

You should write the code for actually without any reason.

He said: You can use is

  (class is a) {classbby = (classb) A; } And if (there is a class) {class z = (classes) a; }  

... or as :

  class Bb = in the form of a class B; If (b! = Null) {// ...}  

Comments