Based on the tags you have used for this question, I am assuming that you think javascript and java the same. THEY ARE NOT. Javascript and java are totally different things.
Based on the tags you have used for this question, I am assuming that you think javascript and java the same. THEY ARE NOT. Javascript and java are totally different things.
As already stated in comments and answer JavaScript and Java are two distinct languages. Their concepts are quite different while their names are similar.
Since Java is more used on the server side or to create standalone application and you seem to intend to create a small page probably making some calculations, JavaScript seems to be more adapted (...without knowing what you precisely want).
You should first learn its fundamentals and also have a look at the Math
global object.