Convertir int a String en tipo clase Enum. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Convertir int a String en tipo clase Enum.

Como hago para convertir o poder ingresar en un clase tipo enumerado (Enum) en java un tipo int utilizando el mĆ©todo Enum.valueOff ( tipo de clase, variable tipo string )...Mi tipo clase enumerado la he creado con un constructor tipo int y deseo que me muestre por pantalla un numero ingresado por consola el cual guardarĆ© en una variable de tipo int, esta variable la invocĆ³ en mĆ©todo Enum.valueOff ( string variable) pero no me lo permite por que esta esperando es tipo string y no int.

9th Sep 2017, 1:32 PM
JUAN ANTONIO VARGAS BUSTOS
JUAN ANTONIO VARGAS BUSTOS - avatar
2 Respostas
0
Sorry but I can't understand your language. Can you translate it to English.
10th Sep 2017, 6:41 AM
Pankaj Bairwa
Pankaj Bairwa - avatar
0
yeah this is the transcription to English How do I convert or be able to enter an Enum type enumerated (Enum) type in java an int type using the Enum.valueOff method (class type, string type variable) ... My type enumerated class I created it with a constructor type int and I want to display a number entered by console which will save in a variable of type int, this variable was invoked in method Enum.valueOff (string variable) but I do not allow it because it is waiting is type string and not int .
10th Sep 2017, 12:59 PM
JUAN ANTONIO VARGAS BUSTOS
JUAN ANTONIO VARGAS BUSTOS - avatar