Como q eu uso o switch com string?
tipo…
switch ( entra )
{
case "artur":
g.drawLine ( 10, 10, 250, 10 + i * 10 );
break;
Ou eu tenho q usar o " if "?
if ( entra.equals("artur")){
Como q eu uso o switch com string?
tipo…
switch ( entra )
{
case "artur":
g.drawLine ( 10, 10, 250, 10 + i * 10 );
break;
Ou eu tenho q usar o " if "?
if ( entra.equals("artur")){
switch não aceita objetos
switch só pra int ou char. Ou tipos que possam ser promovidos implicitamente a int (short, byte).