Article View: borland.public.jbuilder.java.language
Article #8272How can open data file ?
From: Gary
Date: Wed, 04 Apr 2001 15:10
Date: Wed, 04 Apr 2001 15:10
30 lines
1350 bytes
1350 bytes
When I runed the following code, I got file not found error. Can anyone help
me?
import java.io.*;
public class openFile
{
public static void main(String[] args)
{
openFile openFile1 = new openFile();
openFile1.getData();
}
public void getData()
{
try
{
BufferedReader in=new BufferedReader (new FileReader ("data.txt"));
String string=in.readLine();
System.out.println(string);
}catch(IOException e)
{
System.out.println("file not found");
}
}
}
Technical Details
Message-ID:
<3acb3936$1_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a515c97aea6c453,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-04 08:15:34 PST From: "Gary" <seawr@yahoo.com> Newsgroups: borland.public.jbuilder.java.language Subject: How can open data file ? Date: Wed, 4 Apr 2001 11:10:20 -0400 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 209.123.198.73 Message-ID: <3acb3936$1_1@dnews> X-Trace: dnews 986396982 209.123.198.73 (4 Apr 2001 08:09:42 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews