Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Byte data into text file

Status
Not open for further replies.

papaboy2

MIS
Jan 28, 2003
52
0
0
PH
hi i hava a code that ask the user for input, name, age etc and i want to save to my text file? thank you very much! how can i save it to a string?

here is my code:
byte name[] = new byte[100];
int nr_read = 0;
System.out.println("What is your name?");
try {
nr_read = System.in.read(name);
System.out.write(name,0,nr_read);
}
catch (IOException e) {
System.out.print("I'm Sorry. I didn't catch your name.");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top