• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error occure  RSS feed

 
kethare eswaran
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to execute the program it not gett executed.

can you help me.

These program is for to show the content in a file.



import java.io.*;

class showfile
{
public static void main(String arg[])
{
int i;
FileInputStream fin;
try
{
fin=new FileInputStream(arg[0]);
}
catch(FileNotFoundException e)
{
System.out.println("File Not Found");
return;
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("Usage File: ShowFile File");
return;
}
do
{
i=fin.read();
if( i != -1)
{
System.out.println((char) i);
}
}while(i!=-1);
fin.close();
}
}


kethare@sify.com
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Considering the code you have given us does not compile, I am not surprized that you are having problems. Exactly what do you mean by "not gett executed"? What do you expect? What errors are you getting?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!