Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package br.ucb.enums;
  2.  
  3. import java.util.Calendar;
  4.  
  5.  
  6.  
  7. public enum EnumTime {
  8.         MENSAGEM{
  9.         public String getMensagem(){
  10.                 int turno = Calendar.getInstance().get(Calendar.AM_PM);
  11.                 if(turno == 0)
  12.                   return "Bom dia";
  13.                 else if(turno == 1)
  14.                         return "Boa tarde";
  15.                 return "Boa noite";
  16.         }
  17.         };
  18.        
  19.         public abstract String getMensagem();
  20.  
  21. }