Reading text file always returns 0 - Java
问题 I'm trying to read a text file to get a version number but for some reason no matter what I put in the text file it always returns 0 (zero). The text file is called version.txt and it contains no spaces or letters, just 1 character that is a number. I need it to return that number. Any ideas on why this doesn't work? static int i; public static void main(String[] args) { String strFilePath = "/version.txt"; try { FileInputStream fin = new FileInputStream(strFilePath); DataInputStream din =