Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/10-basics/10-hello-world/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Type the code from the exercise into the editor character by character and click "Verify".

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

If you write *heLLo, woRld!* instead of *Hello, World!*, it will be treated as different text, because uppercase and lowercase letters are different characters. The size of a letter is called *case*, and they say: **case matters!** This applies to almost everything in code, so get used to always paying attention to case.
69 changes: 69 additions & 0 deletions modules/10-basics/10-hello-world/en/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Learning a programming language traditionally begins with the "Hello, World!" program, which prints this text on the screen.

```text
Hello, World!
```

In Java, this program looks like this:

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

The text *Hello, World!* appears on the screen thanks to the `System.out.println()` command, where `println()` is short for the English *print line*. It prints the value specified in the parentheses `("Hello, World!")` — in this case, a string. Instead of the example, you can print any other text:

```java
System.out.println("Hexlet — a programming school");
```

The command stays the same; only the content of the parentheses changes.

So that the program understands that the parentheses contain text, it is enclosed in quotes. In Java, a string is always wrapped in **double** quotes `"..."`. You cannot use single quotes `'...'` for a string: they hold a single character (the `char` type), for example `'A'`. If you wrap a string in single quotes, the compiler will point out a syntax error:

Check notice on line 25 in modules/10-basics/10-hello-world/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/en/README.md#L25

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/en/README.md:25:147: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 25 in modules/10-basics/10-hello-world/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/en/README.md#L25

Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/en/README.md:25:185: Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

```bash
# For example, like this
App.java:5: error: unclosed character literal
System.out.println('Hello, World!');
```

The command itself is located inside several constructs that are needed even for the simplest Java programs. In this case, these are the `App` class and the `main()` method.

For now, we won't dwell on them, because understanding them requires a bit of programming knowledge. So in many exercises they are given "as is", meaning you won't have to write them yourself. When the time comes, we'll go through them.

## The meaning of characters

Code consists of commands, and each of them must be written in a specific form. Besides letters, quotes `"`, parentheses `()`, curly braces `{}`, and the semicolon `;` matter in code. A missing or mixed-up character will cause the program to fail to compile. Try to figure out what mistake is made in each of the lines:

```java
System.out.println("I am the King");
System.out.println("I am the King";
System.out.println(I am the King");

Check notice on line 44 in modules/10-basics/10-hello-world/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/en/README.md#L44

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/en/README.md:44:28: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
System.ouprintln("I am the King");
System.out.println("I am the King")
```

Even a small difference — an extra letter, a lost parenthesis, or a forgotten `;` — can prevent the program from working. This also applies to case, that is, the difference between uppercase and lowercase letters. While in ordinary text `Hello` and `hello` look the same, for Java they are different words. Java treats `println`, `Println`, and `PRINTLN` as different names, and only the first option will work.

## Where to practice

Theory sinks in better when you run code alongside it and see the result. As you move through the lessons, you'll constantly come across code examples and descriptions of how they work. To understand them better and be able to use the language, you need to practice and experiment constantly — whenever possible, run all the examples from the theory.

The easiest way to get started with Java is on the [onecompiler](https://onecompiler.com/jshell) website, which lets you run code line by line right in the browser using JShell. Try going there right now and typing this code:

```text
System.out.println(85 * 3);
```

How does this work technically? Unlike languages that are executed line by line by an interpreter, Java code first passes through a compiler and is then executed by the Java Virtual Machine (JVM), which prints the result on the screen:

```text
Code Compiler + JVM Screen
┌──────────────────┐ ┌─────────────────┐ ┌──────────────┐

Check notice on line 65 in modules/10-basics/10-hello-world/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/en/README.md#L65

If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1]) Suggestions: ` Out`, ` out` Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1 Category: CASING
Raw output
modules/10-basics/10-hello-world/en/README.md:65:65: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
 Suggestions: ` Out`, ` out`
 Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
 Category: CASING
│ System.out │ ──→ │ javac + JVM │ ──→ │ Hello, World!│
│ .println(…) │ │ │ │ │
└──────────────────┘ └─────────────────┘ └──────────────┘
```
8 changes: 8 additions & 0 deletions modules/10-basics/10-hello-world/en/data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Hello, World!
tips:
- >
If the editor contains `// BEGIN` and `// END` lines, the code must be
written between those lines.
- |
[What is a compiler?](https://guides.hexlet.io/compiler/)
2 changes: 1 addition & 1 deletion modules/10-basics/10-hello-world/es/EXERCISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class App {
}
```

Si escribes *heLLo, woRld!* en lugar de *¡Hola, Mundo!*, se considerará un texto diferente, ya que las mayúsculas y minúsculas son caracteres distintos. El tamaño de las letras se llama *mayúsculas y minúsculas*, y se dice: **¡las mayúsculas y minúsculas importan!** Esto se aplica a casi todo el código, así que acostúmbrate a prestar siempre atención a las mayúsculas y minúsculas.
Si escribes *heLLo, woRld!* en lugar de *Hello, World!*, se considerará un texto diferente, porque las mayúsculas y minúsculas son caracteres distintos. El tamaño de la letra se llama *mayúsculas y minúsculas* (*case*), y se dice: **¡las mayúsculas y minúsculas importan!** Esto se aplica a casi todo en el código, así que acostúmbrate a prestar siempre atención a las mayúsculas y minúsculas.
54 changes: 42 additions & 12 deletions modules/10-basics/10-hello-world/es/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,69 @@
Tradicionalmente, se comienza a aprender un lenguaje de programación con el programa "Hello, World!", que muestra este texto en la pantalla.
Tradicionalmente, aprender un lenguaje de programación comienza con el programa "Hello, World!", que muestra este texto en la pantalla.

```text
¡Hola, Mundo!
Hello, World!
```

En Java, este programa se vería así:
En Java, este programa se ve así:

```java
class App {
public static void main(String[] args) {
System.out.println("¡Hola, Mundo!");
System.out.println("Hello, World!");
}
}
```

El texto *¡Hola, Mundo!* aparecerá en la pantalla gracias al comando `System.out.println()`, donde `println()` es una abreviatura de la expresión en inglés *print line*. Este comando muestra en la pantalla el valor especificado entre paréntesis `("¡Hola, Mundo!")`, en este caso, una cadena de texto. La cadena de texto se encierra entre comillas dobles `""`. Si no se hace esto, el compilador mostrará un error de sintaxis:
El texto *Hello, World!* aparece en la pantalla gracias al comando `System.out.println()`, donde `println()` es la abreviatura del inglés *print line*. Muestra en la pantalla el valor indicado entre paréntesis `("Hello, World!")` — en este caso, una cadena de texto. En lugar del ejemplo, puedes mostrar cualquier otro texto:

```java
System.out.println("Hexlet — escuela de programación");
```

El comando sigue siendo el mismo; solo cambia el contenido de los paréntesis.

Para que el programa entienda que entre los paréntesis hay texto, este se encierra entre comillas. En Java, una cadena siempre se enmarca con comillas **dobles** `"..."`. No se pueden usar comillas simples `'...'` para una cadena: en ellas se escribe un único carácter (el tipo `char`), por ejemplo `'A'`. Si enmarcas una cadena con comillas simples, el compilador señalará un error de sintaxis:

Check notice on line 25 in modules/10-basics/10-hello-world/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/es/README.md#L25

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/es/README.md:25:153: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 25 in modules/10-basics/10-hello-world/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/es/README.md#L25

Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/es/README.md:25:197: Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

```bash
# Por ejemplo, así
App.java:5: error: unclosed character literal
System.out.println('¡Hola, Mundo!');
System.out.println('Hello, World!');
```

Este comando se encuentra dentro de varias construcciones que son necesarias incluso para los programas más simples en Java. En este caso, se trata de la clase `App` y el método `main()`.
El comando en sí se encuentra dentro de varias construcciones que son necesarias incluso para los programas más simples en Java. En este caso, se trata de la clase `App` y el método `main()`.

Por ahora no nos detendremos en ellas, ya que para entenderlas hace falta saber programar un poco. Por eso, en muchos ejercicios se dan "tal cual", es decir, no tendrás que escribirlas tú mismo. Cuando llegue el momento, las analizaremos.

## El significado de los símbolos

Por ahora, no nos detendremos en ellos, ya que para entenderlos es necesario tener un poco de conocimiento en programación. Por lo tanto, en muchos ejercicios se proporcionan "tal cual", es decir, no tendrás que definirlos tú mismo. Cuando llegue el momento, los analizaremos.
El código se compone de comandos, y cada uno de ellos debe escribirse de una forma determinada. Además de las letras, en el código importan las comillas `"`, los paréntesis `()`, las llaves `{}` y el punto y coma `;`. Un símbolo omitido o confundido hará que el programa no compile. ¿Puedes averiguar qué error hay en cada una de las líneas?

## JShell
```java
System.out.println("I am the King");
System.out.println("I am the King";
System.out.println(I am the King");

Check notice on line 44 in modules/10-basics/10-hello-world/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/es/README.md#L44

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/es/README.md:44:1: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
System.ouprintln("I am the King");
System.out.println("I am the King")
```

A medida que avances en las lecciones, te encontrarás constantemente con ejemplos de código y descripciones de su funcionamiento. Para comprenderlos mejor y poder utilizar el lenguaje, es necesario practicar y experimentar constantemente.
Incluso una pequeña diferencia — una letra de más, un paréntesis perdido o un `;` olvidado — puede hacer que el programa no funcione. Esto también se aplica a las mayúsculas y minúsculas, es decir, a la diferencia entre letras grandes y pequeñas. Si en un texto normal `Hola` y `hola` se ven iguales, para Java son palabras distintas. Java considera `println`, `Println` y `PRINTLN` como nombres diferentes, y solo funcionará la primera opción.

Por lo tanto, siempre que sea posible, ejecuta todos los ejemplos de la teoría y realiza experimentos con los aspectos que no entiendas.
## Dónde practicar

La forma más sencilla de comenzar con Java es en el sitio web [onecompiler](https://onecompiler.com/jshell), que te permite ejecutar el código línea por línea directamente en el navegador. Intenta ir allí ahora mismo y escribir este código:
La teoría se asimila mejor cuando ejecutas el código en paralelo y ves el resultado. A medida que avances por las lecciones, te encontrarás constantemente con ejemplos de código y descripciones de su funcionamiento. Para entenderlos mejor y saber usar el lenguaje, hay que practicar y experimentar constantemente — siempre que sea posible, ejecuta todos los ejemplos de la teoría.

Lo más fácil para empezar con Java es el sitio [onecompiler](https://onecompiler.com/jshell), que permite ejecutar el código línea por línea directamente en el navegador con JShell. Intenta ir allí ahora mismo y escribir este código:

```text
System.out.println(85 * 3);
```

¿Cómo funciona esto técnicamente? A diferencia de los lenguajes que se ejecutan línea por línea con un intérprete, el código en Java primero pasa por un compilador y luego lo ejecuta la máquina virtual de Java (JVM), que muestra el resultado en la pantalla:

```text
Código Compilador + JVM Pantalla
┌──────────────────┐ ┌─────────────────┐ ┌──────────────┐

Check notice on line 65 in modules/10-basics/10-hello-world/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/es/README.md#L65

If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1]) Suggestions: ` Out`, ` out` Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1 Category: CASING
Raw output
modules/10-basics/10-hello-world/es/README.md:65:7: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
 Suggestions: ` Out`, ` out`
 Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
 Category: CASING
│ System.out │ ──→ │ javac + JVM │ ──→ │ Hello, World!│
│ .println(…) │ │ │ │ │
└──────────────────┘ └─────────────────┘ └──────────────┘
```
2 changes: 1 addition & 1 deletion modules/10-basics/20-comments/App.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class App {
public static void main(String[] args) {
// BEGIN
// TODO: добавить метод приветствия
// TODO: add a greeting method
// END
}
}
9 changes: 9 additions & 0 deletions modules/10-basics/20-comments/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
You're writing a program and realize that one part needs to be finished later. So as not to forget, programmers leave themselves notes right in the code — TODO comments.

Add the following single-line comment to the file:

```text
// TODO: add a greeting method
```

When you come back to this spot later, the comment will remind you that there's still unfinished work here.
64 changes: 64 additions & 0 deletions modules/10-basics/20-comments/en/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Almost all programming languages let you leave comments in the code. Comments are not used by the code and are meant solely for people: so that a programmer can leave notes for themselves and for other programmers, explain how the code works, mark errors, or remind themselves of what still needs to be done.

```java
// Delete the line below after implementing the registration task
System.out.println(10);
```

The compiler completely ignores comments — they don't affect how the program runs:

```text
// comment ──→ [ skipped by the compiler ]
System.out.println("hello"); ──→ [ executed → hello ]
// another one ──→ [ skipped by the compiler ]
```

There are three kinds of comments in Java:

**Single-line comments** start with `//`. Any text can follow these two characters; the entire line will not be analyzed or executed.

A comment can take up the whole line:

```java
// For Winterfell!
```

A comment can also be on the same line after some code:

```java
System.out.println("I am the King"); // => For Lannisters!
```

**Multi-line comments** start with `/*` and end with `*/`. It is customary to start each line with the `*` character, although technically this is not required:

```java
/*
* The night is dark and
* full of terrors.
*/
System.out.println("I am the King"); // => I am the King
```

**Documentation comments** start with `/**` and end with `*/`. For these, it is required to start each line with the `*` character.

Documentation comments are a subtype of multi-line comments. In addition, they serve an extra function — they can be collected using the special javadoc tool and produced as documentation for your code. We'll talk about them later, when we cover classes and methods.

## Service comments

While working, you'll come across code like this in our editor:

```java
// BEGIN

// END
```

*BEGIN* and *END* here are ordinary single-line comments that don't affect how the program runs at all. They show where to write the code for the exercise.

```java
// BEGIN
<your solution here>
// END
```

When you see *BEGIN* and *END*, write your code between them and leave the rest unchanged.
11 changes: 11 additions & 0 deletions modules/10-basics/20-comments/en/data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Comments
tips:
- >
[More about
comments](https://www.w3schools.com/java/java_comments.asp)
definitions:
- name: Comment
description: >
text in a program's code that does not affect functionality and is added
by programmers for themselves and their colleagues.
8 changes: 6 additions & 2 deletions modules/10-basics/20-comments/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Crea un comentario de una línea con el texto:
Estás escribiendo un programa y te das cuenta de que una parte hay que terminarla más tarde. Para no olvidarlo, los programadores se dejan notas directamente en el código: los comentarios TODO.

Agrega al archivo el siguiente comentario de una línea:

```text
No sabes nada, Jon Nieve!
// TODO: agregar un método de saludo
```

Cuando vuelvas a este punto más tarde, el comentario te recordará que aquí todavía queda trabajo por hacer.

Check notice on line 9 in modules/10-basics/20-comments/es/EXERCISE.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/20-comments/es/EXERCISE.md#L9

Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN) Suggestions: `an` URL: https://languagetool.org/insights/post/indefinite-articles/ Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US Category: MISC
Raw output
modules/10-basics/20-comments/es/EXERCISE.md:9:10: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
 Suggestions: `an`
 URL: https://languagetool.org/insights/post/indefinite-articles/ 
 Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US
 Category: MISC
75 changes: 54 additions & 21 deletions modules/10-basics/20-comments/es/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
Casi todos los lenguajes de programación permiten dejar comentarios en el código. Estos comentarios no son utilizados por el código y son únicamente para las personas: para que los programadores dejen notas para sí mismos y para otros programadores.
Casi todos los lenguajes de programación permiten dejar comentarios en el código. Los comentarios no son utilizados por el código y sirven únicamente para las personas: para que el programador deje notas para sí mismo y para otros programadores, explique cómo funciona el código, marque errores o recuerde lo que aún queda por hacer.

En Java, hay tres tipos de comentarios:
```java
// Eliminar la línea de abajo tras implementar la tarea de registro
System.out.println(10);
```

* **Comentarios de una línea** que comienzan con `//`. Después de estos dos caracteres puede seguir cualquier texto, la línea completa no será analizada ni ejecutada.
El compilador ignora por completo los comentarios: no afectan al funcionamiento del programa:

El comentario puede ocupar toda la línea:
```text
// comentario ──→ [ omitido por el compilador ]
System.out.println("hello"); ──→ [ ejecutado → hello ]
// otro más ──→ [ omitido por el compilador ]
```

```java
// Por Winterfell!
```
En Java hay tres tipos de comentarios:

También el comentario puede estar en la línea después de algún código:
**Comentarios de una línea** que comienzan con `//`. Después de estos dos caracteres puede seguir cualquier texto; la línea completa no será analizada ni ejecutada.

```java
System.out.println("Soy el Rey"); // => Por los Lannister!
```
El comentario puede ocupar toda la línea:

* **Comentarios de varias líneas** que comienzan con `/*` y terminan con `*/`. Es común comenzar cada línea con el carácter `*`, aunque técnicamente no es obligatorio:
```java
// For Winterfell!
```

```java
/*
* La noche es oscura y
* está llena de terrores.
*/
System.out.println("Soy el Rey"); // => Soy el Rey
```
También el comentario puede estar en la línea, después de algún código:

* **Comentarios de documentación** que comienzan con `/**` y terminan con `*/`. Para estos comentarios es obligatorio comenzar cada línea con el carácter `*`.
```java
System.out.println("I am the King"); // => For Lannisters!
```

Los comentarios de documentación son un subtipo de los comentarios de varias líneas. Además, tienen una función adicional: se pueden recopilar con la herramienta especial javadoc y se pueden generar como documentación para su código. Hablaremos de ellos más adelante, cuando veamos las clases y los métodos.
**Comentarios de varias líneas** que comienzan con `/*` y terminan con `*/`. Es común comenzar cada línea con el carácter `*`, aunque técnicamente no es obligatorio:

```java
/*
* The night is dark and
* full of terrors.
*/
System.out.println("I am the King"); // => I am the King
```

**Comentarios de documentación** que comienzan con `/**` y terminan con `*/`. Para estos ya es obligatorio comenzar cada línea con el carácter `*`.

Los comentarios de documentación son un subtipo de los comentarios de varias líneas. Además, cumplen una función adicional: se pueden recopilar con la herramienta especial javadoc y generar como documentación de tu código. Hablaremos de ellos más adelante, cuando veamos las clases y los métodos.

## Comentarios de servicio

Durante el trabajo te encontrarás con este código en nuestro editor:

```java
// BEGIN

// END
```

*BEGIN* y *END* aquí son comentarios de una línea normales que no afectan en absoluto al funcionamiento del programa. Indican dónde escribir el código del ejercicio.

```java
// BEGIN
<aquí tu solución>
// END
```

Cuando veas *BEGIN* y *END*, escribe tu código entre ellos y deja el resto sin cambios.
9 changes: 9 additions & 0 deletions modules/10-basics/20-comments/es/data.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
---
name: Comentarios
tips:
- >
[Más sobre los
comentarios](https://www.w3schools.com/java/java_comments.asp)
definitions:
- name: Comentario
description: >
texto en el código de un programa que no afecta a la funcionalidad y es
añadido por los programadores para sí mismos y sus colegas.
Loading
Loading