What are File and RandomAccessFile classes?

Answers were Sorted based on User's Feedback



What are File and RandomAccessFile classes?..

Answer / ranganathkini

The java.io.File is represents a filepath and provides
methods to access filesystem services in the Java
application. Services such as creating folders, verifying
the existance or permissions of a file, etc.

The java.io.RandomAccessFile is a class that allows random
record based access to data stored in a file. This class
helps in creating and manipulating files in a record based
way unlike a sequential access provided by streams.

Is This Answer Correct ?    4 Yes 0 No

What are File and RandomAccessFile classes?..

Answer / y s rajasekhara reddy

File
1. Java.io.file
2. Implements Comparable and Serializalble interfaces
3. The File class is used to perform the operations on files
and directories of the file system of an operating system.
4. The contents of the files cannot be read or write.

RandomAccessFile
1. Java.io.RandomAccessFile
2. Implements DataInputStream and DataOutputStream interfaces
3. The RandomAccessFile class has methods that perform the
direct access to data of any part of the file.
4. It provides the facilities to write primitive data to the
files.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is connection class in java?

0 Answers  


Are arrays dynamic in java?

0 Answers  


State some situations where exceptions may arise in java?

0 Answers  


Write code of any action class?

0 Answers  


How can i add a button in applet in java ???

2 Answers  






When parseint method can be used?

0 Answers  


Explain about field hiding in java?

0 Answers  


Why declare Main() inside the class in java ?

0 Answers   HCL,


why java does not support multiple inheritance

41 Answers   Diamond, Euclid, Evergent, KLKJ, Mind Tree, NIIT, SSI Small Scale Industries, Wipro,


Why do we need wrapper classes?

0 Answers  


how to create a jar file in java

1 Answers  


What is data abstraction? Elaborate with example?

4 Answers   BMC, TCS,


Categories