20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.

Slides:



Advertisements
Similar presentations
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
In Review JAVA C++ GUIs - Windows Webopedia.com.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
1 Introduction to Java and Applet Lecture 3 from Chapters 1 and 2 of the complete reference.
Introduction to Java Programming, 4E
For more Lectures and Notes Visit
1-1 Copyright (c) 1999 N. Afshartous Introduction to Java™
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Introduction to the JDK Java for Computational Finance
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
+ 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.
CSE 452: Programming Languages Java and its Evolution.
Advanced Java New York University School of Continuing and Professional Studies.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
Java Lecture 16: Dolores Zage. WWW n Was a method for distributing passive information n added forms and image maps n interaction was only a new way to.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Lecture :2 1.  DEFENTION : Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed.
1 2. Program Construction in Java Programming Fundamentals.
Introduction to Java Programming with Forte Y. Daniel Liang.
1 Programming Fundamentals AITI-GP. 2 Introduction to Programming.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
SOFTWARE TECHNOLOGY - I JAVA/OOP Wickramanayake HMKSK Department of Electrical & Electronic Engineering Faculty of Engineering University.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Java and its Evolution. Contents Java Introduction Java Features How Java Differs from other OO languages Java and the World Wide Web Java Environment.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
1 Introduction to Java. 2 * 10% Assignments/ class participation * 10% Pop Quizzes * 05% Attendance * 25% Mid Term * 50% Final Term.
Introduction to JAVA Programming
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Introduction to Java Programming, 4E Y. Daniel Liang.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Applications Active Web Documents Active Web Documents.
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to Advanced Java Programming
Getting Started ARCS Lab..
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
(Computer fundamental Lab)
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming Lecture 15: Java Basics

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 2 Lecture 15: Java Basics Today’s Topics What is Java? Why Java? Basic Language Constructs HelloWorld.java

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 3 Lecture 15: Java Basics What is Java? “Java is a simple, robust, object- oriented, platform-independent, multi-threaded, dynamic, general- purpose programming environment.”

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 4 Lecture 15: Java Basics Java Virtual Machine (VM) Generated on a specific platform Runs only on that platform C++ Source Program Native Compiler Native Binary Developer’s Computer User’s Computer Generated on a specific platform Runs on any platform with a Java VM Java Source Program Byte Compiler Universal Binary Java VM “The portability of scripting with the performance of compilation” (mostly) “Write once, run anywhere”

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 5 Lecture 15: Java Basics Two Flavors of Java Java Applications –Run as separate, standalone programs on a computer or other device –Do not require a web browser Java Applets –Run as embedded programs inside a web browser –Require web browser with Java VM

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 6 Lecture 15: Java Basics Why Java? Provide dynamic content Great support for network programming Leverage client-side resources Platform-independence simplifies distribution Small byte-code size shortens download time

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 7 Lecture 15: Java Basics Why Java? Faster than other platform-neutral languages (e.g., Perl) Developed with an intense focus on distributed computing for the Internet Comprehensive support libraries for networking, GUI development, client-server apps, etc.

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 8 Lecture 15: Java Basics Basic Language Constructs Basic Types (Table 38.1) Operators (Table 38.2) Control Flow (Table 38.3) Comments (Table 38.4) Documentation from Sun:

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 9 Lecture 15: Java Basics Java Is Not JavaScript Strongly Typed –variables must be declared as a certain type –variables can only hold values of that type Compiled –Java programs must be compiled before they are run

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 10 Lecture 15: Java Basics Java Is Not C++ In C++, but not in Java: –Overloading –Multiple Inheritance –Destructors –Templates

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 11 Lecture 15: Java Basics Java Is Not C++ Java is “simpler and safer” In Java, but not in C++: –Packages –Interfaces Java requires object-oriented analysis and design (optional in other languages like C++) Result: Better Code Reusability

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 12 Lecture 15: Java Basics Getting Started: Tools javac –The Java byte compiler –e.g. javac HelloWorld.java java –The Java virtual machine –e.g. java HelloWorld

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 13 Lecture 15: Java Basics Getting Started: Tools appletviewer –To view applets outside the browser –e.g. appletviewer HelloWorld.html javadoc –Generates HTML doc files for all your Java classes –e.g. javadoc *.java

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 14 Lecture 15: Java Basics Getting Started: Tools Linux –kaffe implementation of Java 1.1 –pre-installed on your laptops Win32 –Sun’s Java Development Kit (JDK) –Version available from Sun (or download from a local mirror)local mirror

20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 15 Lecture 15: Java Basics First Example Application: HelloWorld.java Applet: HelloWorldApplet.java, HelloWorldApplet.html