0% found this document useful (0 votes)
15 views

Unit III Java Script I

Uploaded by

anshbamotra11
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Unit III Java Script I

Uploaded by

anshbamotra11
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Unit-III Java Script-I

JavaScript is a lightweight programming language(“scripting language”) and is used


to make web pages interactive.
• It can insert dynamic text into HTML.
• JavaScript is also known as the browser’s language.
• JavaScript(JS) is not similar to or related to Java.
• Both languages have a C-like syntax and are widely used in client-side and
server-side Web applications.
JavaScript:
• JavaScript programming language was developed by the "Netscape."
• Java Script was created in the first place for DOM manipulation. Earlier websites
were mostly static, after JS was created dynamic Web sites were made.
• Functions in JS are objects. They may have properties and methods just like other
objects. They can be passed as arguments in other functions.
• Can handle date and time.
• Performs Form Validation although the forms are created using HTML.
• No compiler is needed.
Unit-III Java Script-I

Java:
• Java is an object-oriented programming language and has a virtual
machine platform that allows you to create compiled programs that run on
nearly every platform. Java promised, “Write Once, Run Anywhere”.
Features of Java are as follows:
• Platform Independent: The compiler converts source code to bytecode and then
the JVM executes the bytecode generated by the compiler. This bytecode can run
on any platform.
• Object-Oriented Programming Language: Organizing the program in terms of a
collection of objects is a way of object-oriented programming, each of which
represents an instance of the class
• Simple: Java is one of the simple languages as it does not have complex features
like pointers, operator overloading, multiple inheritances, and Explicit memory
allocation.
• Robust: Java language is robust which means reliable
• Distributed: We can create distributed applications using the Java programming
language
Unit-III Java Script-I

Example: Java Program


import java.io.*;
class simple
{
public static void main(String args[])
{
System.out.println("Welcome to Java");
}
}
Example: JavaScript
<!DOCTYPE html>
<html>
<body>
<h2> Welcome to JavaScript </h2>
<script type= "text/javascript">
document.write("Hello World!");
</script>
</body>
</html>
Difference between Java and JavaScript
Differences:
Difference between Java and JavaScript
Java and JavaScript:

You might also like