# Hello World

## Создаем первую пограмму

Запускаем IDE:

![IDEA](https://3348009532-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFXZitT5BKGocx1lAOs%2F-LFXZrUAZ4Ax3TrVctNZ%2F-LFXZx9GGQO2K5rhEZ2z%2FStart_IDEA.png?generation=1529588498844290\&alt=media)

Выбираем пункт меню "File -> New Project"

![New Project](https://3348009532-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFXZitT5BKGocx1lAOs%2F-LFXZrUAZ4Ax3TrVctNZ%2F-LFXZx9IUNT061JY7yAV%2FNewProject.png?generation=1529588471097160\&alt=media)

Устанавливаем тип проекта: "Command Line App", пишем название проекта и выбираем директорию для сохранения проекта. Кликаем "Finish"

![Command Line App](https://3348009532-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFXZitT5BKGocx1lAOs%2F-LFXZrUAZ4Ax3TrVctNZ%2F-LFXZx9K2qhfLN3Jwku4%2FCommandLineProject.png?generation=1529588471155039\&alt=media)

В левой части экрана видим структуру проекта:

![Structure](https://3348009532-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFXZitT5BKGocx1lAOs%2F-LFXZrUAZ4Ax3TrVctNZ%2F-LFXZx9Mtm58_WMKmVRi%2FProjectStructure.png?generation=1529588478600928\&alt=media)

В центральной части — редактор кода:

![IDEA](https://3348009532-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFXZitT5BKGocx1lAOs%2F-LFXZrUAZ4Ax3TrVctNZ%2F-LFXZx9Ohb0n0doch0It%2FHelloWorld.png?generation=1529588499519811\&alt=media)

```
class MyProgram {

    public static void main (String args[]) {
        System.out.println ("Hello World!");
    }
}
```

Вопрос 1.

Почему метод main является static?

Вопрос 2.

Что такое out в System.out.println ("Hello World!")? Куда на самом деле "физически" выводится строка?


---

# 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/yazyk-java.-osnovy/hello-world.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.
