Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Tasks;
- import java.io.File;
- public class FileTest {
- public static void main(String[] args) {
- File fl = new File("C://Users//User//Desktop//Новая папка (3)", "20190418_182427.mp4");
- double bytes = fl.length();
- double kilobytes = bytes / 1024;
- double megabytes = kilobytes / 1024;
- System.out.println(String.format("%.4s", megabytes));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement