![]() |
Text streams
Write a series of lines to a text file and read them back in, verifying their consistency. Details of input and output streams are covered in the course notes. Work LocationPerform all work for this magercise in VisualAge project MageLang Magercises, package magercises.Text Streams. If this project does not appear in your Workspace add it from the repository (if it exists there) or create a new project using this name. Tasks
Perform the following tasks:
34 "an int is " + 34 3.14159 true Close the file and open a FileInputStream to junk. Read the four lines back in. Verify that the four lines read in contain the correct values by first converting the strings (all but the third line) to primitive types. Print "ok" for all correct lines and "not ok" for all incorrect lines.
|
Copyright © 1996-1997 MageLang Institute. All Rights Reserved. |