How to change the code in Arduino with another Arduino?

Here is: Serial - Arduino Reference. The IDE contains the examples for serial communication (also here on this web).