Difference between JavaScript and java
javascript and Java are two completely different programming language in both
concept and design.
JavaScript:-
- JavaScript is invented by "Brendan Eich".
- It is a scripting programming language and its official name is 'ECMA-262'. It viewed on the 'Netscape' browser
(i.e. no longer used browser) in 1995 for the first time, but later on, it has
been adopted by 'ECMA' (a standard browser) in 1997.
- JavaScript is an Object-Oriented
Language, but it doesn't still use classes and create objects from these classes, unlike other languages. Thus it is a prototype-based language, not class-based.
- JavaScript isn't a typed language. Due to this, it
can be defined only 'one type of Number' that can be written either with or
without a decimal symbol.
eg. var pi=3.14 // A number with a decimal
var x=36 // A number without decimal
In case of an extra-large or extra small number you can be written these
numbers using exponential(scientific symbol) as given in example:-
eg. var x=136e6 //means 136000000
var y=136e-6 //means 0.000136
Java:-
- Java is invented by "Sun Microsystems" and designed by 'James Gosling'.
- It is a more complex OOP based programming language and come in the same category as 'C' language. Its first name is "Oak".
- Java is such Object-Oriented Language in which we can define a number of classes and create a number of objects from these classes, as well as instances of this objects.Java, is class-based language.
- Unlike JavaScript, it can define
'Different types of Numbers' like Integer, Short, Long and Floating-Point
number etc.
eg Int var x; //an integer variable