Assignment 1: Writing, Changing, and Debugging a Java Program
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere...
-
Upload
russell-golden -
Category
Documents
-
view
212 -
download
0
Transcript of + Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere...
![Page 1: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/1.jpg)
+
Java vs. JavascriptJessi Style
![Page 2: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/2.jpg)
+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
![Page 3: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/3.jpg)
+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"
![Page 4: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/4.jpg)
+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. }
}
![Page 5: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/5.jpg)
+Javascript
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
JavaScript is a scripting language that was created by Netscape, originally known as LiveScript
![Page 6: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/6.jpg)
+Javascript
Interpreted
Must be placed inside an HTML document
Different browsers
Runtime-only debugging
![Page 7: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/7.jpg)
+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
![Page 8: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/8.jpg)
+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
![Page 9: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/9.jpg)
+Libraries and Frameworks
Java
Struts
Tapestry
Maverick
Javascript
jQuery
Prototype
MooTools
Help programmers by providing access to general and purpose-specific code that can be reused over and over again for different products
![Page 10: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/10.jpg)
+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
![Page 11: + 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.](https://reader036.fdocuments.us/reader036/viewer/2022081700/56649e025503460f94aeda07/html5/thumbnails/11.jpg)
+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