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

Can we have two methods in a class with the same name?

588


What is a wrapper method?

541


What does super keyword do?

565


What are different access specifiers in java? Explain

639


Is linked list a linear or non-linear data structure?

554






What does you mean in math?

546


What are the 3 types of loops in java?

538


What are the actions that can occur when a thread enters blocked state?

591


How many arguments can a method have java?

552


What is the purpose of garbage collection in java, and when is it used?

574


What are the states of thread in java?

528


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

589


What is the difference between import java.util.date and java .util?

582


What is the difference between scrollbar and scrollpane?

617


What is the byte range?

588