O que é enum?

Em java, enum type é um tipo que tem um conjunto fixo de constantes. Um exemplo comumente encontrado é  contendo constantes como os dias da semana :

public enum Dia {

Atente-se: Como são constantes, devem ser escritos em MAIÚSCULAS.

Use o código acima desta forma:

public class EnumDiaTeste {
  Dia dia;
  public EnumDiaTeste(Dia dia){
    this.dia = dia;

  public void verificaDia(){
    switch (dia) {
     case SEGUNDA: System.out.println("Segundas sao ruins"); break;
     case SEXTA: System.out.println("Sextas sao melhores."); break;
     case SABADO:
     case DOMINGO: System.out.println("Finais de semana sao melhores."); break;
     default: System.out.println("O meio da semana eh mais ou menos"); break;
  public static void main(String[] args){
    EnumDiaTeste primeiroDia = new EnumDiaTeste(Dia.SEGUNDA);
    EnumDiaTeste terceiroDia = new EnumDiaTeste(Dia.QUARTA);
    EnumDiaTeste quintoDia = new EnumDiaTeste(Dia.SEXTA);
    EnumDiaTeste sextoDia = new EnumDiaTeste(Dia.SABADO);
    EnumDiaTeste setimoDia = new EnumDiaTeste(Dia.DOMINGO);

Exemplo adaptado de Oracle.

Bons estudos!

Curso JavaFX Free!

Veja detalhes no site da Sun.

(Reposting an email we received from Sang Shin over the weekend)

The 1st session of the “Free 15-week JavaFX Programming (with Passion!)” online course ended as of today (July 25th, 2009) with participation of ~4000 people.

The 2nd session of the course will start from Aug. 25th, 2009. For registration, all you have to do is to send a blank email to the following email alias


This course runs very much like a regular college course in which the students are expected to do weekly homework after studying the presentation material and doing the hands-on lab but it is free and can be taken online.  There is also class email alias where students can ask/answer questions.

For more information, please go to the course websites below.

Course topics: http://www.javapassion.com/javafx/#Topics
Course website: http://www.javapassion.com/javafx
Course FAQ: http://www.javapassion.com/coursefaq.html

Congrats to Sang Shin and Jim Weaver on a highly successful first session and for all of you that missed out on your first chance to sign up… make sure you register today!

Java – Tutoriais e Referencias da SUN

Seguem links de tutoriais e referencias da linguagem Java (by Sun):

Varios documentos de referencia da linguagem Java:


Varios tutoriais JavaSE e JavaEE: http://java.sun.com/javase/reference/tutorials.jsp

Ate a proxima!