1. PriorityQueue/ Queue to List conversion
    List<String> array_list = new ArrayList<String>(pq1);
  2. Split string based on spaces/tab
    // \s is regular expression for space. + stands for more than one space
    str.split("\\s+");
  3. Compare two double
    Double.compare(doubel, double2)
  4. Dimesnsion of 2D array
    // 2 D array arr[][]
    int rows  =  arr.length;
    // Numbers of column in row 0
    int colums = arr[0].length;
  5. Trim whitespace from front and end of string
    // Trim whitespace from 'str'
    str.trim();
  6. Integer to Char
    // Convert integer 'i' to char based on th base 'RADIX'
    char ch = Character.forDigit(i, RADIX);
    
    // Another way 
    int i = 1;
    char b = (char)(i + 'a');
  7. Moving data from a HashSet to ArrayList
    Set<String> hSet = new HashSet<String>();
    
    // Add values
    hSet.add("Set");
    hSet.add("List");
    
    List<String> list = new ArrayList<String>(hSet);
  8. Access values of HashMap
    // map.values() gives a Collection with all the values in HashMap
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
    Collection<Integer> values = map.values();
    // ArrayList has a constructor that accepts a collection.
    List<Integer> valuesList  = new ArrayList<Integer>(values);