import CodeBlock from '@theme/CodeBlock';
import java_examples
from '!!raw-loader!../../../../../bindings/java/examples/java-app/src/main/java/org/iota/client/example/ExampleApp.java';
const javaFunctionName = 'public static void generateAddresses() {', indexStart = java_examples.indexOf(javaFunctionName);
const nextJavaFunctionName = 'public static void getBalance() {', indexEnd = java_examples.indexOf(nextJavaFunctionName);
const generate_addresses = java_examples.substring(indexStart, indexEnd);
You can generate an IOTA address using the
[`GetAddressesBuilder`](./../libraries/java/api_reference#getaddressesbuilder) helper class and calling the `GetAddressesBuilder::from(seed: &str)` function
and respective chaining calls that will return a list of tuples with the generated addresses. You can find more information
on the parameters in the [Address/Key Space section](../../../explanations/address_key_space.md).
The whole process is deterministic. This means the output is the same as long as the seed is the same:
{generate_addresses}
**Output example**:
```string
[
'atoi1qz6dr6dtl0856tf0pczz7gesrf7j8a4vr00q58ld2zx7ttlv3p96snpym9z',
'atoi1qpp7sz28a0ghvd6knwnljr7j2s04qquduuc5vlz94fwf94zznj2yv5ew2c4',
'atoi1qzje6zhg5vu456eg3z84ekcfn3laxqyczche5eeqhcdh3w9yr5sqvr4z4td',
'atoi1qqwhxjmcvmatpedeedapgx0vwyupfwx9k5n4w0lnc5l6vmz78aavwhs55v0',
'atoi1qzg63t9880jtfysvpq7rrynz0rqt3kd2fw8r4934ezraz9dpwvzxkw2dtmh'
]
```
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the
[Chrysalis documentations](https://wiki.iota.org/chrysalis-docs/guides/developer/#iota-15-address-anatom), but here are
parts relevant to this example:
* If an address starts with `atoi` then it means it is related to `devnet`. `iota` stands for `mainnet`.
* Number `1` at the 5th position is just a separator.
* The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format using the
[`Client.bech32ToHex(bech32)`](./../libraries/java/api_reference#bech32tohexbech32-string) function.
If you want to quickly validate any IOTA address, you can use the
[`Client.isAddressValid()`](./../libraries/java/api_reference#isaddressvalidaddress-boolean) function that returns a `bool` value. You should
perform a sanity check on address before using it.