This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i have to create file with n number of records. each record contains some last name,firstname, city and state. what may be the file type i.e extension of the file like doc or txt ? how to insert those recors in to the file ?
please suggest me with code snippets/examples...
thank you [ October 10, 2007: Message edited by: John David ]
To learn how to write to a file you need to read the Java I/O tutorial. Once you know how to write to a file, you need to decide what format you want the data to be in. Common ones are comma separated variables (CSV) and XML, although there are others depending on what exactly you intend to do with the data. The file extension can be anything you like. It is only a hint to the OS as to what program to use to open/edit it. Your final choice will depend a lot on what format the data in the file has. XML files are usually given an .xml extension for example, but this is not an absolute requirement.