Examlex

Solved

Import Java.nio.file.*; Import Java.io.*;

question 14

Essay

import java.nio.file.*;
import java.io.*;
import static java.nio.file.StandardOpenOption.*;
public class WriteFile
{
public static void main(String[] args)
{
Path myFile = Paths.get("C:\\Java\\Input.Output\\myNumbers.txt");
String nums = "12345";
byte[] data = nums.getBytes();
OutputStream output = null;
try
{
_____________________________________
output.write(data)
output.flush();
output.close();
}
catch(Exception badNums)
{
System.out.println("My numbers: " + badNums);
}
}
}
Using the above code, complete the blank line with a statement that will create a writeable file by constructing a BufferedOutputStream object and assigning it to the OutputStream. No output should appear on the monitor, but a file should be created.


Definitions:

Colostrum

The first form of milk produced by mammals immediately following delivery of the newborn, rich in antibodies and nutrition.

Kwashiorkor

A form of severe malnutrition or protein-energy malnutrition characterized by edema, irritability, anorexia, ulcerating dermatoses, and an enlarged liver.

Marasmus

A severe form of malnutrition caused by inadequate intake of protein and calories, characterized by wasting and stunted growth.

SIDS

Sudden Infant Death Syndrome, an unexplained death, usually during sleep, of a seemingly healthy baby less than a year old.

Related Questions