NewtGlobal interview question

Write code in java to find the duplicates given in an array and write code to find the intersection of two given arrays.