import java.io.File;import java.io.FileNotFoundException;import java.io.PrintWriter;import java.util.Scanner;/********************************************************************* * A representation of a simple text document without punctuation or * formatting (apart from line breaks).  *********************************************************************/public class Document {    // A two dimensional array of words. Each row in the array    // represents a single line of text. Lines with no words are represented    // as arrays of length 0.    private String[][] words;      /***********************************************************     * Construct an empty document.     ***********************************************************/    public Document()     {        words = new String[0][0];    }        /***********************************************************     * Construct the document from a file. STUDENTS WON'T WRITE THIS.     *      * @param fileName     * @throws FileNotFoundException     ***********************************************************/    public Document(String fileName) throws FileNotFoundException {        File file;        Scanner docScanner;        String curLine;        int numLines = 0;        file = new File(fileName);        docScanner = new Scanner(file);        // count lines...        while (docScanner.hasNext()) {            docScanner.nextLine();            numLines++;        }        docScanner = new Scanner(file);        words = new String[numLines][];        for (int i = 0; i < words.length; i++) {            curLine = docScanner.nextLine();            words[i] = curLine.split("\\s");            //splitting an empty string results in an array with a single            //Empty string.  We want an empty array...             if (words[i][0].equals(""))                words[i] = new String[0];        }    }    /***********************************************************     * Return the number of lines of text in this document.     *      * @return Number of lines.     ***********************************************************/    public int numLines() {	   		// Make me  	 }    /***********************************************************     * Return the number of words in this document.     *      * @return Number of words.     ***********************************************************/    public int numWords() {        		  // Make me    }    /***********************************************************     * Return the indicated line of text as a single string.     *      * @param lineNum     *            The (0-indexed) line of text to return.     * @return The requested line.     * @throws NoSuchLineException     *             If the indicated line does not exist in this document.     ***********************************************************/    public String getLine(int lineNum) throws NoSuchLineException 	 {  			// Make me          }    /***********************************************************     * Return the entire document as a single string. A single space will     * separate each word on a line. Each line will be terminated with a      * newline character.     *      * @param lineNum     *            The (0-indexed) line of text to return.     * @return The requested line.     * @throws NoSuchLineException     *             If the indicated line does not exist in this document.     ***********************************************************/    public String toString() 	 {  		// make me          }    /***********************************************************     * Save this document to a file.  The format is exactly the      * same as that described in the toString method (hint).     * If the file already exists, it will be overwritten.       * If the file cannot be written, this method returns false.     *      * @param fileName  - Name of the file to be written.     * @return  true if the file was written, false otherwise     ***********************************************************/    public boolean saveDocument(String fileName) {  			// make me  	 }}