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

Is java a prime method?

0 Answers  


Where to store local variables?

0 Answers   Aspiring Minds,


how to call one program .class file in another program

7 Answers   TCS,


What are the object and class classes used for?

0 Answers  


what is session facade ?

3 Answers  


java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

7 Answers   HCL, Wipro,


What are the benefits of operations in java?

0 Answers  


What class is used to create Server side object?

1 Answers   TCS,


What is the meaning of find and replace?

0 Answers  


Does substring create a new object?

0 Answers  


Difference between operator overloading and function overloading

0 Answers   Tavant Technologies, Virtusa,


Can we call a non-static method from inside a static method?

0 Answers  


Categories