0
The conversion can be done as below:
Integer.valueOf(Txt_Email.getText())
If the value is of primitive type Voce can do:
Integer.valueOf(Txt_Email.getText()).intValue()
In your case I’d be:
objFunc_Enc.setEmail(Integer.valueOf(Txt_Email.getText()).intValue())
A hint in Java uses some patterns for identifiers (class name, attributes, and methods), for variable and attribute names using letters in the camelcase pattern with the initial letter lowercase.
Marciano, I’m still starting in java, I understand the theory, but can you show me how the full syntax would look? thanks for your attention.
– Gustavo Freire
Hello Gustavo, what you don’t understand?
– Marciano Machado
For example: objFunc_Enc.setEmail(Txt_email.gettext(); where do I have to insert: Integer.valueOf(Txt_email.gettext())? I thought of a syntax like this: objFunc_Enc.setEmail.Integer.valueOf(Txt_email.gettext()); , but it was an error, so I think I’m wrong.
– Gustavo Freire
I updated the answer, please check.
– Marciano Machado
it worked, it worked: objFunc_Enc.setEmail(Integer.parseint(Txt_email.gettext()); THANKS!!!
– Gustavo Freire