> For the complete documentation index, see [llms.txt](https://kaze.gitbook.io/qa-theory/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaze.gitbook.io/qa-theory/osnovy-programmirovaniya-na-java/signatura-metoda.md).

# Сигнатура метода

Сигнатура метода - это его уникальная идентификационная схема, которая включает в себя имя метода, типы его параметров (их порядок и количество) и тип возвращаемого значения.

Вот пример общего формата сигнатуры метода в Java:

```java
[модификатор_доступа] [тип_возвращаемого_значения] имя_метода([список_параметров])
```

Примеры сигнатур методов в Java:

1. Метод без параметров и возвращаемого значения:

```java
public void printHello()
```

2. Метод с параметрами и возвращаемым значением:

```java
public int sum(int a, int b)
```

3. Метод с параметрами, но без возвращаемого значения:

```java
private void showMessage(String message)
```

4. Метод с параметрами разных типов и возвращаемым значением:

```java
protected double calculateAverage(int[] numbers)
```


---

# 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://kaze.gitbook.io/qa-theory/osnovy-programmirovaniya-na-java/signatura-metoda.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.
