Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

switch case enum java

private enum FooNum {
  //Options for your enum
  A, 
  B
  }

public void foo(FooNum fooNum){

switch(fooNum){
	case A:		
	    //you selected A
    	break;
  	case B:
    	//you selected B
		break;  
  	default:			
	    //do some stuff
	    break;
	} 
}
Comment

java enum in switch statement

private enum FooNum {
  //Options for your enum
  A, 
  B
  }

public void foo(FooNum fooNum){

switch(fooNum){
	case A:		
	    //you selected A
    	break;
  	case B:
    	//you selected B
		break;  
  	default:			
	    //do some stuff
	    break;
	} 
}
Comment

java switch case enum

 switch (BD.usuarioLogado.getTipoAcesso()) {
            case ALUNO:
                Aluno alunoLogado = (Aluno) BD.getUsuarioLogado().clone();
                jTextFieldNOME.setText(alunoLogado.getUsername());
                jTextFieldNOME.setEditable(false);

                jTextFieldDATANASCIMENTO.setText(alunoLogado.getDataNascimento());
                jTextFieldDATANASCIMENTO.setEditable(false);
                
                break;
            case PROFESSOR:
                Professor usuarioLogado = (Professor) BD.getUsuarioLogado().clone();
                break;
            default:
                break;
        }
Comment

switch case with enim java

switch(object.enum) {
    
  case CONSULTOR:
    tipoConsultor = "CO";
    break;

  case CONSULTOR_EN_LINEA:
    tipoConsultor = "CL";
    break;

  case CONSULTOR_POR_PRODUCTO:
    tipoConsultor = "CP";
    break;

  default:
    break;
}
Comment

PREVIOUS NEXT
Code Example
Java :: java date add hours 
Java :: lambda expressions in java 
Java :: android set focus on edittext 
Java :: java arrayList of array to array of array 
Java :: how to turna date into a LocalDateTime java 
Java :: java extends 
Java :: how to stop activity from another activity 
Java :: writing values in 2d array java 
Java :: what is a do while loop in java 
Java :: get arguments in fragment kotlin 
Java :: quarkus maven skip test 
Java :: comment générer un nombre aléatoire en java 
Java :: Create class from string variable JAVA 
Java :: java timeout 
Java :: java pattern check 
Java :: read file from resources java 
Java :: haxe interface 
Java :: java super keyword 
Java :: how to create xml file in java 
Java :: rock paper scissors java 
Java :: online java code fixer 
Java :: anagram java 
Java :: java protected keyword 
Java :: how to disable screenshot in react native 
Java :: how to check duplicate string in java 
Java :: flutter unable to find bundled java version 
Java :: android studio clock bar change color programmatically 
Java :: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config 
Java :: nqueen problem with python 
Java :: spring mvc project example 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =