# Типы данных

### Примитивные типы данных

![](/files/JtyyABSGgEkew83bu3RP)

Числовые значения типа ***long*** указываются с префиксом ***L*** (4587L).

Числовые значения типа ***floan*** указываются с префиксом ***F*** (235.367F).

![Типы отсортированные по размеру](/files/241AZ3YBnoLCVn5xh2ar)

### Ссылочные типы данных

В ссылочные типы входят все классы, интерфейсы, массивы.

#### Классы оболочки

* Byte
* Short
* Integer
* Long
* Float
* Double
* Character
* Boolean

#### Тип String

String предназначен для хранения строк текста.

```java
//Создание строки с помощью конструктора 
String myString = new String("The weather was fine");

//Можно также создать строку используя кавычки ""
String myString = "The weather was fine";
```

#### Перечисляемый тип

Перечисляемый тип имеет конечный набор именованных значений.

```java
enum Size {SMALL, MEDIUM, LARGE, EXTRA_LARGE};
Size size = Size.MEDIUM;
```


---

# 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://andrey-ivantsov.gitbook.io/java/osnovy-yazyka/tipy-dannykh.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.
