print array of different type using a single Generic method