Difference between the File and RandomAccessFile classes - Core Java

What is the difference between the File and RandomAccessFile classes?

The File class is used to perform the operations on files and directories of the file system of an operating system. This operating system is the platform for the java application that uses the File class objects. The contents of the files cannot be read or write.

The RandomAccessFile class has methods that perform the direct access to data of any part of the file. RandomAccessFile class also provides the facilities to read and write data from a single file without closing the streams for each read or write. It provides the facilities to write primitive data to the files.
StringBuilder vs. StringBuffer - Core Java
Difference between StringBuilder and StringBuffer - StringBuffer is thread safe, where as StringBuilder is not. In other words, StringBuffer class is synchronized and StringBuilder class is not synchronized...
How to implement shallow cloning and deep cloning - Core Java
Explain how to implement shallow cloning and deep cloning - Cloning is a process to create copies of objects...
What is an abstract class? Difference between abstract class & interfaces.
bstract class & Interfaces - An abstract class defines an abstract concept which can’t be instantiated...
Post your comment