> For the complete documentation index, see [llms.txt](https://educacion.gitbook.io/programacion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://educacion.gitbook.io/programacion/exercicios-java/ud1-solucions/solucion-asignacions-de-caracteres.md).

# Solución asignacións de caracteres

| Nº | Asignación | Válida (Sí/No) | Comentario |
| -- | ---------- | -------------- | ---------- |

| 1 | `char c = 'a';` | Sí | Literal de carácter válido |
| - | --------------- | -- | -------------------------- |

| 2 | `char c = "a";` | No | Comillas dobles son `String`, no `char` |
| - | --------------- | -- | --------------------------------------- |

| 3 | `char c = 65;` | Sí | Valor entero dentro del rango de `char` (ASCII 'A') |
| - | -------------- | -- | --------------------------------------------------- |

| 4 | `char c = 70000;` | No | Excede el rango de `char` (0–65535) |
| - | ----------------- | -- | ----------------------------------- |

| 5 | `char c = '\u0041';` | Sí | Unicode hexadecimal de 'A' |
| - | -------------------- | -- | -------------------------- |

| 6 | `char c = '\n';` | Sí | Carácter de control válido (salto de línea) |
| - | ---------------- | -- | ------------------------------------------- |

| 7 | `char c = '\t';` | Sí | Tabulación horizontal |
| - | ---------------- | -- | --------------------- |

| 8 | `char c = '';` | No | Vacío no es válido para `char` |
| - | -------------- | -- | ------------------------------ |

| 9 | `char c = 'ab';` | No | Dos caracteres en literal → inválido |
| - | ---------------- | -- | ------------------------------------ |

| 10 | `char c = 0;` | Sí | Valor numérico mínimo para `char` |
| -- | ------------- | -- | --------------------------------- |

| 11 | `char c = -1;` | No | Valor negativo → inválido |
| -- | -------------- | -- | ------------------------- |

| 12 | `char c = '\uFFFF';` | Sí | Valor máximo válido de `char` |
| -- | -------------------- | -- | ----------------------------- |

| 13 | `char c = 3.14;` | No | Decimal → no se puede asignar a `char` directamente |
| -- | ---------------- | -- | --------------------------------------------------- |

| 14 | `char c = ' ';` | Sí | Espacio en blanco → válido |
| -- | --------------- | -- | -------------------------- |

| 15 | `char c = '\'';` | Sí | Carácter comilla simple escapado → válido |
| -- | ---------------- | -- | ----------------------------------------- |

| 16 | `char c = '"';` | No | Hay que escapar la comilla |
| -- | --------------- | -- | -------------------------- |

| 17 | `char c = '\\';` | Sí | Barra invertida escapada → válido |
| -- | ---------------- | -- | --------------------------------- |

| 18 | `char c = '0';` | Sí | Carácter '0' → válido |
| -- | --------------- | -- | --------------------- |

| 19 | `char c = "0";` | No | Comillas dobles → `String` no `char` |
| -- | --------------- | -- | ------------------------------------ |

| 20 | `char c = '\uD800';` | Sí | Carácter UTF-16 válido (aunque es un surrogate) |
| -- | -------------------- | -- | ----------------------------------------------- |
| 21 | `char c = 'Z'`       | No | Falta el ;                                      |
| 22 | `char c = 3199;`     | Si | Simbolo en otro alfabeto. Válido hasta 65.535   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://educacion.gitbook.io/programacion/exercicios-java/ud1-solucions/solucion-asignacions-de-caracteres.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.
