# Методы

***Метод*** — это функция, являющаяся частью некоторого класса, которая может выполнять операции над данными этого класса. В языке Java вся программа состоит только из классов, а функции могут описываться только внутри них. Именно поэтому все функции в языке Java являются методами.

Общий вид метода:

```
type methodName (list of parameters) {
    method body
}
```

Пример:

```
void init(int a, int b) {
    х = а;
    У = b;
}
```

Задание 1

```
Напишите метод, который принимает два арумента, перемножает их и выводит результат на
экран.
```


---

# 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://comaqa.gitbook.io/java-automation/oop-v-java/metody.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.
