The java action will define how many parameters it has, what type each parameter is, and then return type. So yes, to run these actions you just have to pass the respective parameters.
For example this java action accepts a list of file documents, and one object of type file document. Then it returns a boolean.
Hope this helps!
To add to Austins answer, you can add custom java actions to extend your application. Here's the documentation on how to do this https://docs.mendix.com/howto6/extending-your-application-with-custom-java.