Cognizant interview question

difference between c++ and jav