0
try {
                         fileStream = new FileInputStream(fileName);
                         boolean questionnaireNumExists = readLines(fileStream, questionnaireNum);
                    
                         if (!questionnaireNumExists) {
                            
                            dataLine += sQuestionnaireNum; 
                            dataLine += ",";
                         }
                         else System.out.println("The questionnaire number you have entered already exists," +
                                                 " re-enter a number");
                         }
                    catch (Exception e) {
                                         System.err.println(e.toString());
                    }

The compiler skips the try{} and goes directly to the catch{} ... any ideas what might be wrong?

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

It can't "skip the try". An exception is occurring and you need to figure out what it is. I would recommend putting e.printStackTrace() in your catch block.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.