I am trying to read one file in java, following is the code :
public void readFile(String fileName){
try {
BufferedReader reader= new BufferedReader(new FileReader(fileName));
String line=null;
while((line=reader.readLine()) != null ){
System.out.println(line);
}
}catch (Exception ex){}
}
It is working fine in case of txt file. However in case of docx file, it is printing weird characters. How can i read .docx file in Java.