Java Archive

Java Design Patterns List

Here is the list of Java Design Patterns. Each pattern is explained in detail with example and sample code. Hope you find this helpful. Creational Java Design Patterns Abstract Factory Builder Factory Method Prototype Singleton Structural Patterns

Java Sorting using Comparator

Lets see how we can sort our Employee objects using different criteria like id, name, salary. SortTest remains the main class that will perform creating and filling objects for us. This time employee class is plain old

Java Sorting using Comparable

In Java you can do sorting by implementing 2 interfaces 1) Comparable 2) Comparator Here we will see sorting example using Comparable Interface. As an example we will be sorting objects of Employee class. When using comaprable