import java.io.*;
class file
{
public static void main(String args[])throws IOException
{
try
{
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter the File-Name u want to read");
String f=in.readLine();
FileInputStream f1=new FileInputStream(f);
in=new DataInputStream(f1);
String strline;
while((strline=in.readLine())!=null)
{
System.out.println(strline);
}
in.close();
}
catch(Exception e)
{
System.out.println("error"+ e.getMessage());
}
}
}
class file
{
public static void main(String args[])throws IOException
{
try
{
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter the File-Name u want to read");
String f=in.readLine();
FileInputStream f1=new FileInputStream(f);
in=new DataInputStream(f1);
String strline;
while((strline=in.readLine())!=null)
{
System.out.println(strline);
}
in.close();
}
catch(Exception e)
{
System.out.println("error"+ e.getMessage());
}
}
}
No comments:
Post a Comment