Files Read by Multiple Thread

How to read each file on separate thread. Step 1:Get List of all files in the specified folder

    Step 2:Create Class which will display contents of file and implements runnable. Note that I have created constructor to Read More

Binary Search Example

Binary search example in java

 

TreeSet Vs HashSet

Treeset and hashset both belong to set and obey the rule of maintaining uinique elements . But treeset comes with some more added advantage. TreeSet gives ability to sort elements with the help of the compareTo(). More examples on http://www.shivapreals.tech/allpost/java-tutorial/java-collection-tutorial/ HashSet allows null elements. Treeset never allows null.   Hashset is faster as it is not dealing with sorting Read More

Anonymous classes in java

Type2:

 

Test Multiple Read By threads in java