As the others have said, check the online resources first. My personal favorite for JavaScript is:
The JavaScript Knowledge BaseIf you really want a book, I've found "JavaScript, The Definitive Guide" to be very good. It's by David Flanagan and published by O'Reilly. It also touches on using Java with JavaScript...
>Can anyone tell me a book for java script and java for beginners.