This is a thought-provoking question. The resemblance between Hamlet and Arjuna is striking. Both are heroic men who are reluctant to kill other people. At the beginning of the Bhagavad-gita, Arjuna tells his chariot driver, the god Krishna:
Now as I look on
These my kinsmen
Arrayed for battle,
My limbs are weakened,
My mouth is parching,
My body trembles,
My hair stands upright,
My skin seems burning,
The bow Gandiva
Slips from my hand,
My brain is whirling
Round and round,
I can stand no longer:
Krishna, I see such
Omens of evil!
Hamlet expresses the same feelings about being obligated to commit murder. At the end of Act 1, Scene 5 he says to himself:
Unlike Arjuna, Hamlet has no one to give him advice or encouragement. He cannot understand why he keeps procrastinating about fulfilling his duty to his murdered father. In Act 2, Scene 2 he questions himself at some length, including the following words:
O, what a rogue and peasant slave am I!
Is it not monstrous that this player here,
But in a fiction, in a dream of passion,
Could force his soul so to his own conceit
That from her working all his visage wann'd,
Tears in his eyes, distraction in's aspect,
A broken voice, and his whole function suiting
With forms to his conceit? and all for nothing!
What's Hecuba to him, or he to Hecuba,
That he should weep for her? What would he do,
Had he the motive and the cue for passion
That I have?
Later he even seems to be contemplating suicide rather than carrying out his promise to assassinate King Claudius. This is in his soliloquy beginning with:
To be or not to be: that is the question.
Both Arjuna and Hamlet are perplexed about their conflicting feelings of duty and humanitarianism up until the ends of the famous works in which they are featured. No doubt they would understand each other very well if they were able to meet. Both of them have bitter enemies, yet both can feel compassion for their enemies because they understand the good and evil that exists in all human beings, including themselves.
In the end, both Arjuna and Hamlet display their heroic qualities. It would seem that both of them are deterred from action by religious scruples. It would seem that the commandment "Thou shalt not kill" is universal and that a reluctance to kill one's fellow man is part of the human psyche, or of what Carl Jung calls the "universal unconscious." In the New Testament, Jesus tells Matthew:
All they that take the sword shall perish with the sword.
It is very easy to identify with both Arjuna and Hamlet. No doubt this is what makes them such appealing characters. It might be posited that the Ghost who urges Hamlet to take action against the villainous Claudius is comparable to Krishna, who urges Arjuna to do the same.