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 / sri

this code gives Nullpointer exception

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tochararray in java?

502


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

499


What are the basic concepts of OOPS in java?

570


How many types of interfaces are there?

578


What kind of variables can a class consist?

589






How does linkedlist work in java?

508


What is comparator in java?

557


What is ctrl m character?

518


What do you mean by platform independence? What is an interface?

563


Explain the overview of UDP messaging.

735


What language is an assembler written in?

551


Can you explain the cs option of java interpreter?

506


What are constants and how to create constants in java?

558


What are exception handling keywords in java?

609


How many functional interfaces does java 8 have?

606