Sadece bunu sormayı merak ediyorum, belki de anlamsız.Java instanceof sınıf adı
biz gibi, java instanceof kullanıyor: Aşağıda gibi kullanamazsınız neden
if (a instanceof Parent){ //"Parent" here is a parent class of "a"
}
:
if (a instanceof Parent.class){
}
ikinci görünümünden daha mantıklı 'örneği' Does sıkı programlama? "Ebeveyn" ve "Parent.class" arasındaki fark nedir?
İlgili http://stackoverflow.com/questions/496928/what-is-the-difference-between-instanceof-and-class-isassignablefrom –
İlgili http://stackoverflow.com/questions/2590640/why-cant -a-class-variable-to-instanceof – PeterMmm
Not: ikinci yaklaşım için, 'Parent.class.isInstance (a)' uygun kontrol olur. – Vulcan