Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.annotation.processing.SupportedSourceVersion;
- import java.io.*;
- import java.util.logging.Filter;
- public class Main {
- public static void main(String[] args) {
- String filePath = "pat do datoteka";
- File file = new File(filePath);
- File[] files = file.listFiles();
- long max_length = 0;
- File tmp = null;
- for(int i = 0; i < files.length; i++) {
- if(max_length < files[i].length()) {
- max_length = files[i].length();
- tmp = files[i];
- }
- }
- System.out.println(tmp.getName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement