Here are the primitive data types that you will see a lot in Java: byte, short, int, long, float, double, boolean, char. So what about 'var'? We see that a lot in JavaScript, but what does it mean in Java? Well, as of Java 10, they added a new variable type, and you guessed it, it's 'var'. Is it the same 'var' in JavaScript? Almost, it is. It can be used as a String, int, float, etc.
But here is the difference: only as a local variable. You cannot use it as a global variable. In JavaScript, you can even go with "variableName = 1345" and then on the second line, you can say "variableName = 'Hey';". This is a big difference that you should always keep in mind when working with these languages. JavaScript automatically converts data types depending on the value you give, but Java has strict rules for it. Both have benefits and disadvantages.