Java FileNameFilter example to list files with specific extension

If you need to pick up specific extensions from the given directory and you ask yourself how to filter files using Java. Should implement java FilenameFilter class and override accept() method. Then pass object to list() method to get specific file extensions. Java FileNameFilter example will show you all these stuffs.

Run the java … Read more

Two ways compare Java Double

This sample shows two ways compare Java Double object with another Double object or two dobule primitive values using methods of java.lang.Double class

Output First number is greater Value c1 = 1 Second number is greater Value c2 = -1

How to read CSV File using Java StringTokenizer

Reading CSV file is required often in java projects. Instead of using parsing it manually via array or something like that. This sample shows how to parse comma separated file using Java StringTokenizer or read csv file using Java StringTokenize. Parse CSV File using StringTokenizer

Input data “Banana”,”Apple”,”Orange”,”Kiwi” “Mango”,”Lemon”,”Cherry”,”Grape”,”Tomato”,”Strawberry” Output Line number: 1, Token … Read more

Please share it if you found this useful
Hide Buttons