- 1
what is the difrence between Java & java script
what is the difrence between Java & java script and is there relationship between them
2 Respostas
+ 5
Java is an Object Oriented Programming language while JS is an Object Oriented Scripting language.
Now you must find the difference between programming language and scripting language
In fact a scripting language is a programming language, which is interpreted, rather than compiled!
The interpreter executes the program directly, translating each statement into a sequence of one or more subroutines already compiled into machine code. (Web Browser, Adobe Photoshop, ... have an Interpreter Engine for executing JS)
Java, C#, ... compiled into bytecode, the virtual machine-friendly interpreted language. (JVM is Java Virtual Machine, is an abstract computing machine that enables a computer to run a Java program. )
In other words, a compiler or an interpreter is a program that converts program written in high-level language into machine code understood by the computer. Scans the entire program and translate it as a whole into machine code. It takes less amount of time to analyze the source code but the overall execution time is slower.
Interpreter>
- Translates program one statement at a time.
- It takes less amount of time to analyze the source code but the overall execution time is slower.
- No intermediate object code is generated, hence are memory efficient.
- Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.
- Programming language like Python, Ruby use interpreters.
Compiler >
- Scans the entire program and translates it as a whole into machine code.
- It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
- Generates intermediate object code which further requires linking, hence requires more memory.
- It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.
- Programming language like C, C++ use compilers.
No any relationship between java and js, but you can write an interpreter engine using java for running JS