Java and Javascript

Hello

What is the difference between Java and Javascript. I did search but I want to understand more about these languages.

Thank you.

This question is really broad. From reading the differences in which they are used in your search results, what don’t you understand?

Hey there @eimaioutis,

Java is a programming language developed by the company Oracle that made its debut in 1991.

JavaScript is a scripting language that is used with HTML and CSS to build the base of what is the internet now. It was developed by Brendan Eich, and now is one of the most popular language out there for web development, because it can basically do everything.

The name can be confusing but, JavaScript used the name java so maybe it can get a little popularity from an already existing programming language Java. Java is a Object Oriented programming language that is used to create programs and software, while Javascript is an interpreted scripting language that means, it will compile and run at the same time, while Java is a compiled language, which means it needs to be compiled first.

Javascript is a weak typed language while Java is a strong typed language.

Java uses the filename extension of .java while javascript uses the filename extension of .js

Here’s an example of hello worlds in both languages:
Javascript:

console.log('Hello World');

Java

class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

What @Roma said is right, this is a really broad question that have a really long answer that will take a whole video to explain, and we wouldn’t have time for that. Hopefully this can clarify a little bit what the differences are.

Have a good day!

1 Like

Thank you so much. Now I knew somehow the difference between these languages. But I will look deeper on these languages in the near future. For now I’m still learning HMTL and CSS. Thanks a lot.