Java   View all facts   Glossary   Help
action > writing to a file
Next actionreading from a file    Upaction

writing to a file comparison table
Subject have syntax is a kind of is a subtopic of
action kbTop 
writing to a file
//Instantiate a stream, and a PrintWriter
FileOutputStream streamVariableName = new FileOutputStream(fileNameOrPath);
PrintWriter printerVariableName = new PrintWriter(streamVariableName)
//Write a string to the file
printerVariableName.print(string);
//Write a string and a newline to the file
printerVariableName.println(string);
//Close the file
streamVariableName.close();
actionInput and Output

Next actionreading from a file    Upaction