You are viewing a single comment's thread. Return to all comments →
// Comparing the class if(element.getClass() == Student.class) a++;
if(element.getClass() == Rockstar.class) b++; if(element.getClass() == Hacker.class) c++;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Java Instanceof keyword
You are viewing a single comment's thread. Return to all comments →
// Comparing the class if(element.getClass() == Student.class) a++;
}