April 20023CSG11 Electronic Commerce Java (1) John Wordsworth Department of Computer Science The University of Reading Room 129,

Slides:



Advertisements
Similar presentations
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Advertisements

Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Introduction to Java Kiyeol Ryu Java Programming Language.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
1 Introduction to Java and Applet Lecture 3 from Chapters 1 and 2 of the complete reference.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Created by Ron Beglieter (based on the Java Tutorial) 1 What is Java? Java technology is both a programming language and a platform; Programming Language.
ACM/JETT Workshop - August 4-5, Object-Oriented Basics & Design.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
Introduction to Java Programming CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
Introduction to Java Programming CS 21a: Introduction to Computing I First Semester,
+ 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.
April 20023CSG11 Electronic Commerce Design (1) John Wordsworth Department of Computer Science The University of Reading Room.
Programming Languages and Paradigms Object-Oriented Programming.
Advanced Java New York University School of Continuing and Professional Studies.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Java Language and SW Dev’t
Intro to Java 2 By Geb Thomas Based on the Java TutorialJava Tutorial.
CS107 Introduction to Computer Science Java Basics.
FRST JAVA PROGRAM. Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications.
Introduction to Java and Object-Oriented Programming AJSS Computer Camp Department of Information Systems and Computer Science Ateneo de Manila University.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Lecture :2 1.  DEFENTION : Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
1 Programming Fundamentals AITI-GP. 2 Introduction to Programming.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
April 20023CSG1HTF 1 Electronic Commerce HTML forms John Wordsworth Department of Computer Science The University of Reading
April 20023CSG11 Electronic Commerce HTML John Wordsworth Department of Computer Science The University of Reading Room 129, Ext.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Chapter 1: Introduction Java Programming Language How the Java Virtual Machine Works (compiling, etc…) Update by: Dan Fleck Coming up: The Java Programming.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
ACM/JETT Workshop - August 4-5, : Defining Classes in Java.
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette August 27, 2004 Last update:
Introduction to Java John Lewis. Course Overview Introduction Object Orientated Programming Java Structure and Syntax Using the Java Platform Advanced.
April 20023CSG11 Electronic Commerce Java (2) John Wordsworth Department of Computer Science The University of Reading Room 129,
April 20023CSG11 Electronic Commerce Markup languages John Wordsworth Department of Computer Science The University of Reading
April 20023CSG11 Electronic Commerce Transaction processing John Wordsworth Department of Computer Science The University of Reading
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Outline Anatomy of a Class Encapsulation Anatomy of a Method Graphical Objects Graphical User Interfaces Buttons and Text Fields Copyright © 2012 Pearson.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
April 20023CSG1DE2 1 Electronic Commerce Design (2) John Wordsworth Department of Computer Science The University of Reading Room.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
CMSC 202 Computer Science II for Majors Fall 2010 Introduction Version 9/101.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
Electronic Commerce Java (1)
Chapter No. : 1 Introduction to Java.
Introduction to.
Internet and Java Foundations, Programming and Practice
Chapter 4: Writing classes
CS100J Lecture 7 Previous Lecture This Lecture Java Constructs
Electronic Commerce Design (1)
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:

April 20023CSG11 Electronic Commerce Java (1) John Wordsworth Department of Computer Science The University of Reading Room 129, Ext 6544

April 20023CSG12 Lecture objectives Outline the place of the Java language in E-commerce Revise the concepts of object-oriented programming Describe the structure of a Java class and its parts Describe the structure of a Java application, and the way it uses objects Explain how Java implements inheritance

April 20023CSG13 What is Java An object-oriented programming language invented by Sun Microsystems A collection of classes that model useful objects: windows, buttons, text areas, files, databases … A language for developing applications that can be executed on many platforms:  Write Java source code  Compile to Java bytecodes (javac)  Execute under the control of the Java Virtual Machine (java)

April 20023CSG14 Java in e-commerce Client programming with applets:  Classes for setting up and controlling the graphical user interface Server programming with servlets:  Classes for managing the interface with tier 1 (JSPs)  Classes for managing the interface with tier 3 (EJBs)

April 20023CSG15 An object-oriented language Object - an instance of a class: variables methods Message - executing a method: destination object (class) parameters Class - a blueprint for objects: class variable (static) and class method (static) instance variable and instance method constructor inheritance Interface - a collection of methods

April 20023CSG16 An interface for a simple bank account public interface AccountIf { void deposit (int amt); void withdraw (int amt); void showBal; }

April 20023CSG17 A class for a simple bank account public class Account implements AccountIf { private String sortcode, acctno; private int balance; Account (String sc, String an) { sortcode = new String (sc); acctno = new String (an);balance = 0;} public void deposit (int amt) { balance = balance + amt; } public void withdraw (int amt) { balance = balance – amt;} public void showBal { System.out.println ( “Sort code “+sortcode+” Acct number “+acctno=“ Balance “+balance); }

April 20023CSG18 A program to use a bank account public class AccountMain { public static void main (String [] args) { Account ac1 = new Account ("304050", " "); ac1.showBal(); ac1.deposit(500); ac1.showBal(); ac1.withdraw(575); ac1.showBal(); }

April 20023CSG19 A bit of inheritance public class DAccount extends Account { DAccount (String sc, String an, int opening) { super (sc, an); balance = opening;} public void withdraw (int amt) { if (amt < balance) { balance = balance - amt; } else { System.out.println ( "Withdrawal not allowed"); } }

April 20023CSG110 A program to use a deposit account public class DAccountMain { public static void main (String [] args) { DAccount ac2 = new DAccount ("304050", " “, 1000); ac1.showBal(); ac1.withdraw(500); ac1.showBal(); ac1.withdraw(500); ac1.showBal(); }

April 20023CSG111 Sample output Sort code Account number Balance 1000 Sort code Account number Balance 500 Withdrawal not allowed Sort code Account number Balance 500

April 20023CSG112 Key points Java is an object-oriented language for writing portable applications. Java has classes that support the construction of programs to run in Tier 1 (applets) and Tier 2 (servlets) of an e-commerce system. Java classes have a regular structure that can be adapted to writing object-oriented applications, classes, and objects.