Think back. Have you ever done something differently to cope with what is actually going on? Denied it, forgot it, acted like a little kid, or even acted rude? If so, you have used an unconscious maneuver intended to minimize the anxiety of the problem: a defense mechanism. In changing our perception of the problem, it makes it a lot easier to deal with. There are many examples of the different defense mechanisms in movies:
Displacement was shown when Jen took out her anger out on a piñata instead of the person or thing that made her angry. She displaced her anger onto something more acceptable. Denial was shown when the girlfriend was motivated to forget the fact her boyfriend was breaking up with her. She denied the fact that the breakup was real. Intellectualization was shown when Elle decided to study and get into Harvard law school rather than the breakup between her and her boyfriend. She is avoiding her real emotions and focusing on something more abstract and impersonal. Rationalization is shown when Jim Carrey rationalized why he did not get his job promotion by saying he didn't want to be tied down anyway. He provided a reasonable-sounding explanation for his failure. Sublimation is shown when Gretchen uses an essay about Caesar and Brutis's relationship to take out her frustration with Regina, instead of taking her anger out on Regina and ruining their friendship. She is transforming a social unacceptable impulse into a social valued (schoolwork) goal. Reaction formation is shown when the Queen is somewhat annoyed with the Principal, she pretends to be very sweet and gives her to Joseph to give her a job elsewhere. Regression is shown when Jenna acts like a child when Matt tells her that they are not friends anymore. Jenna is returning psychologically to a younger and safer time to deal with her anxiety about not having Matt as a friend anymore. Repression is shown when Sam stumbles on his words when he is trying to talk to an attractive woman, showing his desire for her. He is blocking unacceptable impulses from consciousness. Projection is shown when Cecilia makes Claire look like she wants attention, when really she is the one who craves it. She is unconsciously putting her negative quality of wanting attention onto another girl so she does not look bad.
However, they did not add Identification with the aggressor.
This boy is adopting ways of the army because he does not want to be hurt or threatened. He is adopting the psychological characteristics of them to stay safe. People need to be careful of this because children who grow up around hurt and violence will take on the characteristics of this and grow up this way too. Then it will become a chain and personality formation will be harmed for all of their ancestry.
Defense mechanisms are just a way for people to transfer negative feelings from their anxiety and hurt into different ways that don't harm the person who hurt them, or to make themselves able to cope with it more positively.