Assuming I have an array of User objects where each object is actually one of two classes that extends User. ComputerUser and HumanUser both extend User.
Assume I’m iterating through the list and each object is named o when I am using it.
Can I figure out if o is a ComputerUser or HumanUser simply by comparing like this:
if(o.getClass().equals(ComputerUser.class)) {}
else if(o.getClass().equals(HumanUser.class)) {}
etc