How to filter specific type of Files using FileFilter class in java?

Below java code show how to filter specific type of files using FileFilter class – To implement the FileFilter interface we need to create an accept() method which takes a java.io.File object as parameter. In the method we check wheter the name ends with “.txt” and if so we return true, else false. When we …

Read More

How to Write/Store an object to file in java?

Writing a Java objects to a file is called as Serialization in java. In order to do this, you have to implement the Serializable interface, and use ObjectOutputStream to write the object into a file. To do this we have created Employee class which implements java.io.Serializable. To write an object to a stream call the …

Read More