import java.io.*;
class Demo
{
public static void main(String args[])
{
File f=new File("1234.msg");
String arr[]=f.list();
System.out.println(arr.length);
}
}
Answer Posted / sarath
so what is your question..?
the code gives compilation error... because it should throw a IOException..
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
Can we create an object of private class?
What is increment in java?
How dead lock situation occurs in java and how you can identify it?
How many classes can any class inherit java?
When should we create our own custom exception classes?
What is string pooling concept?
State one difference between a template class and class template.
Define a package.
Why do we need wrapper class?
Which java ide is used the most?
What about main() method in java ?
What is a substring of a string?
Is arraylist a class in java?
What is a line break?
What variables are stored in stack?