Xero-java-sdk: While make AccountingApi calls, there is no mention of the company name as parameters in the api call.
How does the javasdk know, which company the api is referring?
Each request to the API is made with an access token; that access token is specific to an organisation for which the user has authorised your app.
If your app is a private app, this authorisation is made during the app creation process in the developer portal. For public and partner apps, authorisation is the part of the flow performed after obtaining a request token - documentation here.