Basic Sorting

Filed in SortingTags:

Sorting in java of arrays of any type that implements an interface: Comparable or Comparator The program sort in java: import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args) { String [] s = {"zzz","ZZZ","ddd", "AAA","xxx","aaa"}; Arrays.sort(s); //reverse order Arrays.sort(s, Collections.reverseOrder()); //case insensitive order Arrays.sort(s,String.CASE_INSENSITIVE_ORDER); } }

Understanding Dynamic Proxies

Filed in Java

Dynamic proxies have existed since J2SE 1.3 and have been mainly utilized as a mechanism for method interception so that additional behavior could be interposed between a class caller and its callee. Dynamic proxies exemplify AOP (Aspect Oriented Programming) which bundled within Spring Framework API, it provides alternative for implementing common design patterns like Façade, [...]

Singleton Pattern In Java

Filed in JavaTags: , , ,

Singleton pattern is probably one of most popular widely used patterns that I have seen. It’s implemented to create an access restriction to a specific resource like: printer, network, pooling, memory, logging. Here is a simple and correct implementation:

 
 
January 2012
M T W T F S S
     
 1
2345678
9101112131415
16171819202122
23242526272829
3031