
for a file that exist what will be the length() method in the file class return

Here is a code that checks the file existence and find the length of the file in bytes.
import java.io.*;
class FileExists
{
public static void main(String[] args)
{
File f=new File("c:/data.txt");
if(f.exists()){
long s=f.length();
System.out.println(s);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
