But the point is that I'm receiving wrong values (I mean different than those provided by my teacher)
My previous lesson was about "encryption", and after every lesson he is giving me different task, like write program in my language (which is going to be used during my school secondary school certificate - IT)
For example for 'A' im receiving 65, and my teacher said its $41 (this dollar doesn't really matter, I need just number for calculations)
$ is the Visual Basic (ugh) HEX symbol, and it's probably used in other languages as well. Apparently your teacher has a history in one of these languages before he started Java. Tell him that Java uses 0x instead and that he should consider switching to prevent confusion; you may even get a little extra credit for it.