Video
We use the predefined object System.out of the class PrintStream (subclass of OutputStream).
Example:
OutputStream os = System.out;
File
We create an object of the class FileOutputStream (subclass ofOutputStream) associated to the File object that identifies the file to open for writing.
Example:
FileOutputStream os = new FileOutputStream("data.txt");
Note: It is not possible to write to an Internet resource by simply using an output stream.