# Supported Types

The IC4J **Candid Library** allows Java developers to serialize and deserialize Java native types to **IC Candid IDL types.**

*"Candid is an interface description language. Its primary purpose is to describe the public interface of a **service**, usually in the form of a program deployed as a **canister smart contract** that runs on the Internet Computer. One of the key benefits of Candid is that it is language-agnostic, and allows inter-operation between services and front-ends written in different programming languages, including Motoko, Rust, and JavaScript."*

{% embed url="<https://smartcontracts.org/docs/candid-guide/candid-concepts.html>" %}
What is Candid?
{% endembed %}

{% embed url="<https://smartcontracts.org/docs/candid-guide/candid-types.html>" %}
Candid Types
{% endembed %}

This table shows implicit mapping between Candid types and default Java type assignment.

| Candid    | Java        |
| --------- | ----------- |
| bool      | Boolean     |
| int       | BigInteger  |
| int8      | Byte        |
| int16     | Short       |
| int32     | Integer     |
| int64     | Long        |
| nat       | BigInteger  |
| nat8      | Byte        |
| nat16     | Short       |
| nat32     | Integer     |
| nat64     | Long        |
| float32   | Float       |
| float64   | Double      |
| text      | String      |
| opt       | Optional    |
| principal | Principal   |
| vec       | array, List |
| record    | Map, Class  |
| variant   | Map, Enum   |
| func      | Func        |
| service   | Service     |
| null      | Null        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ic4j.com/reference/api-reference/supported-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
