I donβt know much about Java, I know enough to get me through to the end, but I'm not perfect yet, so I apologize if this is a stupid question.
I am trying to write a class that might have some kind of object passed to it, but I need to check if it has passed a specific method. How can I check this?
Hope this makes sense. Greetings.
EDIT
Thanks for all the quick answers! I'm not too familiar with interfaces, etc., so I'm not quite sure how to use them. But, in order to better understand what I'm doing, I am trying to create a class that will affect the alpha of the object, for example. ImageView
or TextView
, for example. How can I create an interface for this without listing each object individually, when all I need to do is make sure they have a .setAlpha()
method? Does this make sense? Greetings.
source share