We would like to know how to get the length of current file in long.
import java.io.File; public class MainClass { public static void main(String[] a) { File myFile = new File("C:" + File.separator); System.out.println(myFile.length()); } }
The code above generates the following result.