Ask coding questions

← Back to all posts
What's the difference?
JordanDixon1 (299)

What's the difference between Java and Javascript? Are they made by different companies? I know that Javascript is made for the brower while Java is used for applications but I would like to know what the differences are. Syntax wise.

Commentshotnewtop
mwilki7 (951)

JavaScript is what's most commonly used to provide functionality to web pages (unless you're a diehard CSS expert).
Java CAN be used for websites (see .jsp)

Being programming languages they naturally have a lot in common (classes, variables, functions, etc...) but are typically used for completely different things.

Whoever named JavaScript has some serious explaining to do.

Geocube101 (566)

Despite their name, Java and JavaScript are 2 very different things
Java has way more keywords, different functionality and different purposes


Both of the following examples show the code required to print "Hello World" to the console
An Example of Java

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

An Example of Javascript

console.log('Hello World');