A very good introduction to this type is available here: http://javabat.com/doc/ifboolean.html.
Este exercício foi convertido para o PLM do excelente sítio de exercícios http://javabat.com/