There is no specific Java code example for transferring TON directly in the documentation. However, you can use the ton4j library for Java development on TON, which supports HTTP connectivity, core functionality, and emulation. You can find examples and usage patterns in the ton4j GitHub repository. For support, you can join the Telegram chat:
@ton4java.
When transferring TON, you will need the destination address, the amount in nanoTON (1 TON = 10⁹ nanoTON), and an optional comment in the message body.
Source: SDKs overview