1 / 11

Java vs. Javascript

Java vs. Javascript. Jessi Style. Java. Compiled Can stand on its own Written once, run anywhere Two-stage debugging. Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems. Five Primary Goals.

palma
Download Presentation

Java vs. Javascript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java vs. Javascript Jessi Style

  2. Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems

  3. Five Primary Goals It should be "simple, object-oriented and familiar” It should be "robust and secure” It should be "architecture-neutral and portable” It should execute with "high performance” It should be "interpreted, threaded, and dynamic"

  4. Syntax Derived mainly from C++ Source files must be named after the public class they contain The compiler will generate a class file for each class defined in the source file The keyword public denotes that a method can be called from code in other classes The keyword static indicates that the method is associated only with the class and not with any specific instance of that class. The keyword void indicates that the main method does not return any value to the caller class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } }

  5. Javascript JavaScript is a scripting language that was created by Netscape, originally known as LiveScript • Most commonly used as part of web browsers • Also being used in server-side programming, game development and the creation of desktop and mobile applications • Supports much of the structured programming syntax from C • Functions are objects, which have properties and methods • Variables can be defined using var

  6. Javascript Interpreted Must be placed inside an HTML document Different browsers Runtime-only debugging

  7. Similarities • Object Oriented languages • Both can run in a browser • Both can run on a server • Both are influenced by the programming community • Both have libraries and frameworks

  8. Object Oriented Programming • Language model organized around objects rather than actions • Terminology- • Class: Defines the characteristics of the Object • Object: An Instance of a Class • Property: An Object characteristic, such as color • Method: An Object capability, such as walk • Package: a namespace for organizing classes and interfaces in a logical manner • Inheritance: A Class can inherit characteristics from another Class

  9. Libraries and Frameworks • Help programmers by providing access to general and purpose-specific code that can be reused over and over again for different products Java • Struts • Tapestry • Maverick Javascript • jQuery • Prototype • MooTools

  10. Resources • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript • http://www.seguetech.com/blog/2013/02/15/java-vs-javascript • http://www.htmlgoodies.com/beyond/javascript/article.php/3470971 • http://www.java.com/en/download/faq/java_javascript.xml

  11. Questions • What is the difference between compiled and interpreted? • Compiled means the code is changed into bytecode which is not readable by humans and any Java Virtual Machine can run it. Interpreted is executed in the same syntax in which it is written • What is Object Oriented Programming? • Object-oriented programming is a programming paradigm that represents concepts as "objects" that have data fields (attributes that describe the object) and associated procedures known as methods. • How are Java and Javascript similar? • Refer to slide 7

More Related