Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read everything as a String?

 
Patrick O'Dowd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've just started my developer assignment - URLyBird

Maybe I'm missing something here, but when I read the data in from the data file as bytes - How can I tell if the data read in should be treated as a string or an int etc. Granted I can hardcode this in to the code, but I guess I shouldn't do this as then the metdata/database could not be changed without modifying the code. So at the moment I'm treating everything as a String

Thanks.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at your assignment description once more. If it says "numeric data" you should read into the appropriate Java primitive. If it says otherwise the read into a String using the appropriate encoding.
 
Kelly Wood
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read and store all field values as String. Since all fields are for displayed only (except the owner field which I have validate code to make sure it is numeric), I found it easilier to keep them as Strings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic