It technically compiles and does what you want it too. However, I suppose it's something you should probably avoid.
Type: Posts; User: helloworld922
It technically compiles and does what you want it too. However, I suppose it's something you should probably avoid.
Use Java's implicit casting:
gender = "" + sex;
I believe you can also explicitly cast to string, but i'm not sure about this one:
gender = (String) sex;