Writing in string from keypad

Hi guys.

I have a problem with writing into string or array from keypad, exactly I can't do this. How is make it? What I need to create code, so that every time the some key was switched to retain this key(number key in string or array)?

Please for your professional skills.

Good evening.

exactly I can't do this.

You must have tried something. Something must have happened. We don't write code for you. We help YOU write code, by explaining why what you wrote is wrong/inefficient/in need of improvement.