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


Please Help Members By Posting Answers For Below Questions

How will you reverse a link list without using recursion?

597


What does super keyword do?

561


What do you know about the garbage collector in java?

575


What is the exception hierarchy in java?

485


What is public static void main?

569






Explain the importance of join() method in thread class?

640


What about interthread communication and how it takes place in java?

543


how are methods defined?

555


What is meant by null and void?

538


What is boolean used for?

589


Can we override compareto method?

503


What is a website container?

509


Is char a data type in java?

545


what is synchronization? : Java thread

563


Can we have any code between try and finally blocks?

562