This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

file question  RSS feed

 
hoang vo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I hava these information:
name - string
alias - string
info1 - string
info2 - string
..


the info can go from 1 to 10

kind of like having a structure and saving that structure for later to load.
any info would be good on how to start it
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two options:

1) Use a database and JDBC (too complex for me to go into here)

2) Write a class Person that represents your data, then make sure the class implements the Serializable interface. Serializable objects can be written and read using ObjectOutputSteam and ObjectInputStream. (Probably easier for begginers)
 
hoang vo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you.
I will look into that.

currently i m using filewriter and filereader(2 be code)
and using a character sequence of "\n\n" as my end of the info for that person. But have been thinking about other methods to save structural information.

thanx again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!