0

I'm trying to get the user input of their age in byte data type in JavaFX. I'm trying to get the data from a textfield but I'm having trouble figuring out how to convert the byte into a string. This is the piece of code I have of it

String t = Byte.toString(age1.getText());

Is it possible to convert the byte input from textfield into a string?

Harshal Parekh
  • 5,918
  • 4
  • 21
  • 43
Elk
  • 11
  • 1
  • Does this answer your question? [Convert byte to string in Java](https://stackoverflow.com/questions/8654141/convert-byte-to-string-in-java) – Daniel Brose May 18 '20 at 02:53
  • *how to convert the byte into a string* = `String str = new String(bytes);` - see https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#String(byte[]) – Scary Wombat May 18 '20 at 02:54

0 Answers0