If those objects happen to store ints, then you can get the ints out and add them up. If the objects you put in don't store ints, then there are no ints there to add anyway.
For instance, if you put in Integer objects (possibly without knowing it by passing an int primitive to something that
autoboxes(⇐click) it for you), then you can call Integer's intValue() method to get the int out, or just let auto-unboxing do it for you.
If you put in some other object that stores an int, then you'll have to get that int out by whatever means that object provides. For instance maybe it's a Person with a height, that has a getHeight() method.
If the method return Object and does not use
generics(⇐click), then you'll have to cast. For example:
I think auto-ubox might even let you do: