GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaTutorial/src/F001_Variables.java at master · windweb/JavaTutorial

Expand file tree

/

F001_Variables.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
32 lines (23 loc) · 1.98 KB
/

F001_Variables.java

Copy path

File metadata and controls

32 lines (23 loc) · 1.98 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public class F001_Variables {
public static void main(String[] args) {
// Объявление переменной типа int и присвоение ей значения 30
int myAge = 30; // int: 32-битное целое число со знаком. Диапазон от -2^31 до 2^31-1.
// Вывод значения переменной myAge в консоль
System.out.println(myAge); // При выполнении программы в консоли будет отображено число `30`.
}
}
/*
Ваш класс `Types` в Java является простым примером, демонстрирующим объявление и
использование переменной целочисленного типа `int`.
Давайте разберем ваш код подробнее:
1. **Класс `Types`**: Это основной класс вашего файла Java.
В Java, каждый файл обычно содержит один публичный класс, имя которого соответствует имени файла.
2. **Метод `main`**: Это точка входа в вашу программу.
Когда вы запускаете программу, исполнение начинается именно с метода `main`.
3. **Переменная `myAge`**:
- `int myAge = 30;` - здесь вы объявляете переменную `myAge` типа `int` и инициализируете ее значением `30`.
- Тип `int` - это 32-битное целое число со знаком, что означает,
что оно может содержать значения от -2^31 до 2^31-1 (от -2,147,483,648 до 2,147,483,647).
4. **Вывод в консоль**:
`System.out.println(myAge);` - этот код выводит значение переменной `myAge` в консоль.
*/
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.