Você está na página 1de 66

JAVA

MÉTODOS
FERRAMENTAS DO JAVA (métodos, etc)
ARRAYLIST

POLIMORFISMO
OVERRIDING
overloading
INTERFACES
MÉTODOS ABSTRATOS
interface

VIDA DOS OBJETOS
Construtores
MÉTODOS ESTÁTICOS
Types of exceptions
Checked exceptions: These are the exceptions that are checked by the compiler
at compile time. If a method throws a checked exception, then the caller of the
method must either handle the exception or declare it in the throws clause.

Unchecked exceptions: These are the exceptions that are not checked by the
compiler at compile time. They include runtime exceptions and errors.
Types of exceptions

finally

A palavra-chave finally representa um trecho de código que será sempre executado,
independentemente se uma exceção ocorrer. Usado depois do catch.


O bloco finally é muito utilizado quando queremos liberar algum recurso, como: uma
conexão com o banco de dados, um arquivo de dados, etc.
throws
Throws


OBS: Pode tratar várias exceções em um único bloco catch
Erros
Errors

The Error class represents the serious problems that cause the program to abort. They
include out of memory error, stack overflow error, and so on.


Errors são um tipo especial de Exception que representam erros da JVM, tais como
estouro de memória, entre outros. Para este tipo de erro normalmente não é feito
tratamento, pois sempre quando um java.lang.Error ocorre a execução do programa é
interrompida.

Você também pode gostar