> 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/ud2-programacion-estructurada/arrays/operacions.md).

# Operacións

As principais operacións que se poden realizar con un Array son as seguintes, partindo do seguinte exemplo:

```java
double notas[] = new double[10];
```

1. **Acceso a un valor:** O acceso a un valor faise de maneira individual utilizando o índice que corresponda

```java
/* O acceso a notas faise mediante notas[indice], e permitenos recuperar
 o valor para asignalo a outra variable */
double variable = notas[3];
//Podese tamen imprimir o valor por pantalla
System.out.println(notas[3]);
```

2. **Asignación de un valor:** Asignación de valores faise de maneira individual utilizando o índice para acceder a posición de memoria correspondente na que se asigna o valor deseado.

```java
notas[3] = 7.5;
```

3. **Obter o tamaño de un array:** O tamaño podese coñecer mediante a propiedade length do obxecto array

```java
int tam = notas.length;
```

4. **Recorrer un array:** Para recorrer un array, o mais comun e utilizar un bucle. Por exemplo se quixésemos mostrar por pantalla os valores do Array notas:

```java
for(int i = 0; i < notas.lenght; i++ ){
    System.out.println(notas[i]);
}
```


---

# 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/ud2-programacion-estructurada/arrays/operacions.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.
