Exception Catching Error
<p>here's my code:</p>

<pre><code>import java.util.*;
import java.io.*;
import java.lang.*;

public class Home {

    public static void main(String[] args) {
        FileOutputStream home,file,filein,fileinin;
        int x = 0;
        int y = 0;
        int yc = 0;
        int z = 0;
        int zc = 0;
        //TestCase
        String Annotation0 = "Hello";
        String Annotation1 = "World";
        String Annotation2 = "How Are You";
        String Annotation3 = "Today?";
        String Annotation4 = "Fine";
        String Annotation5 = "Thanks";
        List&lt;List&gt; corpus0 = new ArrayList&lt;List&gt;();
        List&lt;List&gt; corpus1 = new ArrayList&lt;List&gt;();
        List&lt;String&gt; document0 = new ArrayList&lt;String&gt;();
        List&lt;String&gt; document1 = new ArrayList&lt;String&gt;();
        List&lt;String&gt; document2 = new ArrayList&lt;String&gt;();
        List&lt;String&gt; document3 = new ArrayList&lt;String&gt;();
        List&lt;List&lt;List&gt;&gt; biglist = new ArrayList&lt;List&lt;List&gt;&gt;();
        biglist.add(corpus0);
        biglist.add(corpus1);
        corpus0.add(document0);
        corpus0.add(document1);
        corpus1.add(document2);
        corpus1.add(document3);
        document0.add(Annotation0);
        document1.add(Annotation1);
        document2.add(Annotation2);
        document2.add(Annotation3);
        document3.add(Annotation4);
        document3.add(Annotation5);

        try{
            home = new FileOutputStream("C:\\Windows\\Temp\\Home.html");
            new PrintStream(home).printf("%s", "&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt; Home &lt;/h1&gt; \n");
            System.out.println("Home Created Successfully");
        while (x&lt;biglist.size()){
            yc=0;
            try {
                file = new FileOutputStream ("C:\\Windows\\Temp\\Corpus"+x+".html");
                System.out.println("Corpus Added");
                new PrintStream(home).printf("%s%s%s%s%s", "&lt;A href=\"/C:/Windows/Temp/Corpus",x,".html\"&gt;Corpus ",x,"&lt;/A&gt;&lt;Br&gt;\n");
                new PrintStream(file).printf("%s%s%s","&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt; Corpus ", x,"&lt;/h1&gt; \n");
                while (yc&lt;biglist.get(x).size()){
                    zc=0;
                    try{
                        filein = new FileOutputStream ("C:\\Windows\\Temp\\Document"+y+".html");
                        System.out.println("Document Added");
                        new PrintStream(filein).printf("%s%s%s","&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt; Document ", y,"&lt;/h1&gt; \n");
                        new PrintStream(file).printf("%s%s%s%s%s", "&lt;A href=\"/C:/Windows/Temp/Document",y,".html\"&gt;Document ",y,"&lt;/A&gt;&lt;Br&gt;\n");
                        while (zc&lt;biglist.get(x).get(y).size()){
                            try{
                                fileinin = new FileOutputStream ("C:\\Windows\\Temp\\Annotation"+z+".html");
                                System.out.println("Annotation Added");
                                new PrintStream(fileinin).printf("%s%s%s%s%s","&lt;html&gt;\n &lt;body&gt;\n &lt;h1&gt; Annotation ", z,"&lt;/h1&gt; \n &lt;p&gt;",biglist.get(x).get(y).get(z),"&lt;/p&gt; \n &lt;/body&gt; \n &lt;/html&gt;");
                                new PrintStream(filein).printf("%s%s%s%s%s", "&lt;A href=\"/C:/Windows/Temp/Annotation",z,".html\"&gt;Annotation ",z,"&lt;/A&gt;&lt;Br&gt;\n");
                                z++;
                                zc++;}                      
                            catch(Exception e) {System.out.println("Error Annotating");
                                z++;
                                zc++;}}
                        new PrintStream(filein).printf("%s","&lt;/body&gt; \n&lt;/html&gt;");
                        y++;
                        yc++;}
                    catch(Exception e) {
                        System.out.println("Error Making Document");
                        y++;
                        yc++;}}
                new PrintStream(file).printf("%s","\n&lt;/body&gt; \n&lt;/html&gt;");
            x++;}
            catch(Exception e) {
                System.out.println("Error Making Corpus");
                x++;
             }
        }
        new PrintStream(home).printf("%s","\n&lt;/body&gt; \n&lt;/html&gt;");}
        catch (Exception e){
            System.out.println("Fatal Error Home Creation Failed");
        }


    }

}
</code></pre>

<p>Every time I run this I get the following output:</p>

<pre><code>Home Created Successfully
Corpus Added
Document Added
Annotation Added
Document Added
Annotation Added
Error Annotating
Corpus Added
Document Added
Error Making Document
Document Added
Error Making Document
</code></pre>

<p>which to me means that it successfully added a document and caught an exception at the same time? I'm really not sure how this is possible maybe i just don't understand exception catching fully. Please help!</p>
