Advertisement
Timur69

Megabytes

Mar 31st, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. package Tasks;
  2.  
  3. import java.io.File;
  4.  
  5. public class FileTest {
  6. public static void main(String[] args) {
  7. File fl = new File("C://Users//User//Desktop//Новая папка (3)", "20190418_182427.mp4");
  8. double bytes = fl.length();
  9. double kilobytes = bytes / 1024;
  10. double megabytes = kilobytes / 1024;
  11. System.out.println(String.format("%.4s", megabytes));
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement