Velocity Reviews

Velocity Reviews (
-   Java (
-   -   Throws IO Exception in method problem. (

justineee 10-29-2008 02:04 PM

Throws IO Exception in method problem.
Hi Everyone,

I want this readfile method to be called in my other class but the
problem is the "throws IO Exception" code..
It says in the other class that "unreported exception; must be caught or declared to be thrown"

import java.util.*;

public class ReadFile
public void loadFile()
throws IOException
int nWords = 0;
FileReader f = new FileReader ("initlist.txt");
Scanner input = new Scanner ( f );
while (input.hasNextLine())
String line = input.nextLine();

How will I fix this?? Thanks


All times are GMT. The time now is 01:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.