Java and Javascript, both are best in their use and both have comparatively different as well.

Java is generally,
- A strong computer programming language.
- It an independent and computing platform to build a software application.
- It treats every project as objects and classes.
- Java compiles a byte code in .class extension.
JavaScript is,
- Javascript is light as well as a dynamic computer programming language.
- It is easy to use rather than it’s user-friendly.
- Javascript used to make web pages more attractive.
- And also known as a scripting language.
Java and Javascript, both are a different type of application.
BASIC COMPONENTS BETWEEN JAVA AND JAVASCRIPT.
There are some basic components which make java and javascript different from each other.
OBJECTS:
In Java, objects are only based on class and compile its file in the .class extension, moreover, it never makes any program without creating a class,
Secondly, Javascript is based on a prototype which also extension as prototype.js.
LANGUAGE:
Java is strong, safe and static programming language whereas Javascript is a high-level programming language which dynamic, light and easy to use.
PLATFORM:
Java has an independent platform and Java applications are only run on JVM rather than Javascript has developed browser even its codes are only run on the browser.
MEMORY:
JAVA has high files which use much storage of the device as compared to this,
Javascript doesn’t use much memory and store its files in lesser space than java.
COMPILED VS INTERPRETED:
Java does both the work compile as well as interpreted its data, whereas Javascript only interpreted the language.
CONCURRENCY:
In concurrency, there are two basic terms thread-based approach in Java which is used like stitching, whereas,
the second term, the event-based approach in Javascript which is used to handling the changes on the application.
MOBILE APPLICATION:
Java supports not only in android but as well as in IOS mobiles and on the other hand, Javascript meant to used by the third party.
THESE ARE SOME COMPONENTS WHICH MAKE JAVA AND JAVASCRIPT DIFFERENT TO EACH OTHER AS WELL AS THE BOTH FOR DIFFERENT USES.