-
Notifications
You must be signed in to change notification settings - Fork 83
Feature/feature andreza #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andreza-vilar
wants to merge
3
commits into
paulorievrs:master
Choose a base branch
from
andreza-vilar:feature/featureAndreza
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,6 +22,53 @@ Nenhuma linha que está a frente das duas barras ( <b>//</b> ) é interpretada p | |||||
|
||||||
**Obs**.: O comentário de várias linhas é mais utilizado para documentar o que o método faz. | ||||||
|
||||||
# Documentação com Javadoc | ||||||
|
||||||
Javadoc é uma ferramenta que gera documentação HTML a partir de comentários no código-fonte Java. Esses comentários devem estar em blocos iniciados por `/**` e terminados por `*/`. A documentação gerada é muito útil para entender APIs e bibliotecas Java. | ||||||
|
||||||
|
||||||
## Exemplo de Comentário Javadoc | ||||||
|
||||||
```java | ||||||
/** | ||||||
* A classe Calculadora realiza operações matemáticas básicas. | ||||||
*/ | ||||||
public class Calculadora { | ||||||
|
||||||
/** | ||||||
* Soma dois números inteiros. | ||||||
* | ||||||
* @param a o primeiro número | ||||||
* @param b o segundo número | ||||||
* @return a soma de a e b | ||||||
*/ | ||||||
public int somar(int a, int b) { | ||||||
return a + b; | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
## Tags Comuns do Javadoc | ||||||
|
||||||
- `@param` - Descreve um parâmetro do método. | ||||||
- `@return` - Descreve o valor de retorno do método. | ||||||
- `@throws` - Descreve as exceções que o método pode lançar. | ||||||
- `@see` - Adiciona uma referência a outra classe ou método. | ||||||
- `@deprecated` - Marca o método ou classe como obsoleto. | ||||||
|
||||||
## Gerando a Documentação | ||||||
|
||||||
Para gerar a documentação, use o comando `javadoc` no terminal: | ||||||
|
||||||
```sh | ||||||
javadoc -d docs src/com/exemplo/Calculadora.java | ||||||
``` | ||||||
|
||||||
Este comando cria a documentação HTML no diretório especificado (`docs`). | ||||||
|
||||||
Para mais detalhes, consulte a [documentação oficial do Javadoc](https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ajustar para a versão LTS mais recente
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Talvez seja interessante deixar o link da documentação do Java como exemplo de output do javadoc |
||||||
|
||||||
|
||||||
<h2> Indentação </h2> | ||||||
Para manter uma boa leitura do código é necessário uma indentação, que ao longo de suas práticas vai se tornando mais fácil de se utilizar. Para você perceber a diferença entre um código indentado ou não, vai abaixo os dois exemplos. | ||||||
|
||||||
|
@@ -49,4 +96,4 @@ public class Indentacao2 { | |||||
``` | ||||||
Aos olhos humanos fica mais fácil de se entender e enxergar. Para o compilador em alguns casos não irá fazer diferença, mas até para você que está programando fica melhor de se organizar. | ||||||
|
||||||
[Próximo](./04-Variaveis.md) - Variáveis | ||||||
[Próximo](./04-Variaveis.md) - Variáveis |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adicionar uma observação bem breve informando que as IDEs também conseguem gerar o javadoc