?
Solved

JBuilder 7 error:  catch

Posted on 2003-02-25
1
Medium Priority
?
160 Views
Last Modified: 2010-03-31
I am getting this error in my code for catch;


try
    {
      SAXParserFactory spf =SAXParserFactory.newInstance
     ();
      SAXParser parser = spf.newSAXParser();
      XMLReader r = parser.getXMLReader();
    }
 catch(IOException e) {
      e.printStackTrace();
    }

Error:
The exception can never be thrown in the corresponding try block.
0
Comment
Question by:kaushalshah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
yongsing earned 200 total points
ID: 8023655
You are trying to catch an exception (IOException) that can never be thrown. Change IOException to Exception.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question