Javatpoint Logo

input output file stream

By: rajesh*** On: Sat Aug 19 17:20:01 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
import java.io.*;
class Readfile{

public static void main(String args[])throws IOException
{

FileInputStream fis=new FileInputStream ("A.txt");
int ch;
while((ch=fis.read())!=-1)

System.out.print((char) ch);
fis.close();

}


}


in this program why we use first int for ch and after we use char for ch


why???
Up0Down