Mass Technologies interview question

Difference between C++ and Java. How to find prime number?