I received an error and I have this structure in my program
public interface Shapes{
//methods here
}
public class ShapeAction implements
You haven't really shown us enough code to tell what you're trying to achieve, but in general:
If you want to make a method that can accept multiple types of arguments, you want to parameterize the method, not the entire class.
public Shape takeAction(T argument);
Obviously that doesn't really offer much compile time type safety, you'll still probably have to manually resolve the argument to some subset of restricted types at runtime.