While using Gtalk i noticed that whenever the other person is typing on his/her keyboard then on my menu bar "Mr. A is typing" comes, how is that possible. if that is possible then i think it is also possible to all the thing that i am typing or any other person is typing
It's possible because of interactive web pages that monitor changes in the status of their clients. When two people have established a connection, then the server computer can indeed know what each person is doing.
If I understand you right, it sounds like you're worried about a security issue, that Google could reveal what you are typing even before you commit to sending the line. I suspect that's true in principle, but it is reasonable to believe that they will not deliberately "snoop" by passing on or analyzing partial lines other than to identify the fact that one is indeed being typed.
I think it is just to let you know the other person has not left...they're still typing a message.
I believe Skype has a similar feature; it uses a pencil icon when the other person is typing.
Anything you haven't sent yet has not left your computer. "X is typing" is all the information that these programs send. If you want to see this for yourself, you can install a packet capture program like Wireshark and check the data.