/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
System.
out.
println("Com Break: "+ comBreak
(1)); System.
out.
println("Com Return: "+ comReturn
(1)); }
public static String comBreak
(int mes
){ switch (mes){
case 1:
mesExtenso = "Janeiro";
break;
case 2:
mesExtenso = "Fevereiro";
break;
case 3:
mesExtenso = "Março";
break;
default:
mesExtenso = "Mês inválido";
break;
}
System.
out.
println("Instruções executadas antes do return"); return mesExtenso;
}
public static String comReturn
(int mes
){
switch (mes){
case 1:
return "Janeiro";
case 2:
return "Fevereiro";
case 3:
return "Março";
default:
return "Mês inválido";
}
//Qualquer instrução daqui para baixo gera o erro "unreachable statement"
//return "Forever alone :( ....";
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbigiQ29tIEJyZWFrOiAiKyBjb21CcmVhaygxKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKCJDb20gUmV0dXJuOiAiKyBjb21SZXR1cm4oMSkpOwoJfQoJCglwdWJsaWMgc3RhdGljIFN0cmluZyBjb21CcmVhayhpbnQgbWVzKXsKCQlTdHJpbmcgbWVzRXh0ZW5zbyA9ICIiOwoJCXN3aXRjaCAobWVzKXsKCQkJY2FzZSAxOiAKCQkJCW1lc0V4dGVuc28gPSAiSmFuZW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