Home >Web Front-end >Front-end Q&A >Is javascript the same as java?
javascript is different from java. Javascript is a programming language used to display various effects on the client, while java is the basic programming language on computers and servers; JavaScript is a dynamically typed language, and Java is a statically typed language.
The operating environment of this tutorial: windows7 system, javascript1.8.5&&java8 version, Dell G3 computer.
Javascript is different from java. Although Java and javascript are both programming languages, they are two completely different language architectures.
Java is a new generation of object-oriented programming language launched by SUN Company, a programming language that is particularly suitable for Internet application development. It is an interpreted language with syntax rules similar to C.
JavaScript is a product of Netscape. Its purpose is to extend the functions of Netscape Navigator and develop an object-based and event-driven interpreted language that can be embedded in Web pages; it is a compliance with the ECMA 262 language specification. A realization.
The difference between java and javascript
The performance of Javascript is the programming language used to show various effects in our client, while the performance of java is the computer and basic programming languages on the server.
1. Java is an object-oriented language, and JavaScript is a scripting language based on objects and event-driven languages.
2. Java needs to run on the JVM (Java Virtual Machine) of JDK or JRE; JavaScript runs on the web browser, so no specific platform is required. Java mainly runs on the server side; JavaScript mainly runs on the client browser.
3. Java source code must be compiled before execution, but JavaScript code does not need to be and can be directly interpreted and executed by the browser.
4. JavaScript is a dynamically typed language; Java is a statically typed language. Java cannot change the length of an array after it is defined, but JavaScript can.
5. JavaScript is weakly typed, that is, it does not need to be declared before use, but the browser interpreter checks the data type at runtime; Java is strongly typed, that is, all variables must be declared before compilation;
6. JavaScript’s object-oriented implementation is based on prototype (prototype-based), and Java is based on class (class-based);
7. Java’s grammar rules are stricter than JavaScript’s The more strict, the more powerful the function.
8. Java language code is a language that has nothing to do with HTML; JavaScript language code is a text character format that can be directly embedded in HTML documents and can be loaded dynamically.
For more programming related knowledge, please visit: Programming Video! !
The above is the detailed content of Is javascript the same as java?. For more information, please follow other related articles on the PHP Chinese website!