Javascript and Java have similar name because (a) Javascript syntax is loosely…

2015

Javascript and Java have similar name because

(a) Javascript syntax is loosely based on Java's syntax

(b) Javascript is stripped down version of Java

(c) Java and Javascript are originated from island of Java

Codes :

  1. A.

    (a) only

  2. B.

    (a), (b) and (c)

  3. C.

    (a) and (b)

  4. D.

    (a) and (c)

Attempted by 238 students.

Show answer & explanation

Correct answer: A

Answer: Only the statement that JavaScript's syntax is loosely based on Java's syntax is correct.

Explanation:

  • Naming history: The language was created in 1995 and originally called Mocha/LiveScript. It was renamed to JavaScript partly for marketing reasons to suggest a connection to Java's popularity, not because it is the same language.

  • Syntax influence: JavaScript borrowed some syntactic conventions (for example C-like braces and control structures), so its syntax is loosely based on Java and related C-style languages.

  • Not a stripped-down Java: JavaScript is a separate, dynamically typed, prototype-based language with different semantics and goals; it is not a subset or simplified version of Java.

  • Not related to the island: The language name does not refer to the island of Java.

Explore the full course: Mppsc Assistant Professor