// File -s unshih
import java.io.*;
class FileRead
{
public static void main(String args[])
{
try{
// ehleed file -aa neene
// command muriin parametr
FileInputStream fstream = new FileInputStream("textfile.txt");
// DataInputStream -n objectiig todorhoiloh
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
//File -s ugugdliig mur muruur unshina
while ((strLine = br.readLine()) != null) {
// Unshsan aguulgaa mur muruur hevlene
System.out.println (strLine);
}
//Oroltiin ursgalaa zaaval haah heregtei.
in.close();
}catch (Exception e){// Aldaa barij avah
System.err.println("Error!!!: " + e.getMessage());
}
}
}
ЭХ КОДЫГ ТАТАХ
Маш хэрэгтэй зүйл оруулсан байна. Баярлалаа
ReplyDelete