Capgemini Interview Question

two programs and some core java questions