how to perform splunk subsearch through splunk java SDK
A subsearch is part of a search so just submit the main search with the subsearch included using the prescribed methods.
If there's something specific that's holding you back then please provide the details.