Banco Bradesco interview question

basic OOPs and 2 question on string manipulation