How to get file size in java code, example?

 How to get file size in java code, example

Now we are writing a very simple code for find the file size in java.
Copy and paste this code in your java class.

public static long getFileSize(String filePath)
    {
        File f = new File(filePath);
        return f.length();
    }

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

Shallow Copy Deep Copy Java example

Database Connection using NODE JS example