BPJ444: Business Programming Using Java Introduction Tim McKenna.

Slides:



Advertisements
Similar presentations
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
Advertisements

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.
Lab#1 (14/3/1431h) Introduction To java programming cs425
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.
Object Orientated Programming
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.
Introduction to Java Kiyeol Ryu Java Programming Language.
1 Introduction to Java and Applet Lecture 3 from Chapters 1 and 2 of the complete reference.
Lab 1 Instructor: Jolanta Soltis.
Introduction to Java.
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
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.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
Introduction to Java Presented by Daniel Rosenthal Friday, November 16 th, 2007.
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.
BA22001 Introduction to Java Instructor: Jingwu He.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
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.
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
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
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,
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
POS 406 Java Technology And Beginning Java Code
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
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.
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.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
introductory lecture on java programming
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
Java Computer Industry Lab. 1 Programming Java Java Basics Incheon Paik.
การเขียนโปรแกรมภาษา จาวา Java Programming อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 1.
ITP 109 Week 2 Trina Gregory Introduction to Java.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Introduction to JAVA Programming
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.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
Sachin Malhotra Saurabh Choudhary
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Before You Begin Nahla Abuel-ola /WIT.
Introduction Enosis Learning.
Introduction Enosis Learning.
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)
Java History, Editions, Version Features
Java Evolution Java History. Java Features.
Chap 1. Getting Started Objectives
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:

BPJ444: Business Programming Using Java Introduction Tim McKenna

Introduction n The Focus of BPJ444 n What is Java? n The Sun Java 2 Platform n Getting Started with Java Programming n The IBM i5, iSeries, AS/400 Java Platform

The Focus of BPJ444 n Java programming skills (85%) n IBM tool and platform (15%) –IBM WebSphere Development Studio Client for iSeries which is based on Eclipse IDE. Use Eclipse. –IBM iSeries as a database platform n preparation for other courses –DOMINO, iSeries Practicum, Web Services Architecture

What is Java? n invented at Sun Microsystems in 1991 by James Gosling, a Canadian. n named the new language “Oak” after looking out his office window n later renamed “Java” following a trademark search n 1994: hey, this Web thing is way cool n May 23, 1995: Java and HotJava browser officially announced n JDK 1.0 available November, 1995

What is Java? n Java starts with C/C++ language form: –syntax, semantics, expressions n Java improves C/C++: –no pointers in Java … hooray –no memory manglement malloc/free –Java does automatic “garbage collection” –strings are objects, not null-terminated arrays –int, long, float are the same everywhere –out of bounds array index checking at run time

Java cleans up C++ n no operator or keyword overloading –things mean what you think they mean n no header files –Java uses classes and packages n no multiple inheritance n no standalone functions –in Java, all methods belong to a class n no preprocessor –everything is in the Java language n no structures or unions –everything is in a class

Java is better n for Web, business & application programming (no memory manglement) n safer than C & C++ (no pointer stuff) n rich library of programming features n more portable across platforms n downloadable Java applets can run –in any browser (unlike ActiveX) –safely in the Java security “sandbox” (unlike ActiveX)

Java formula n Java = C++ – complexity and ambiguity + security and portability

Java is Object Oriented n focus is on objects, i.e. classes of things n objects have attributes: fields or variables (data) n objects have behaviour: methods to act on data n Procedural languages like C or COBOL … –use algorithms to act on data – trusting all other programs to behave properly and not corrupt data. –data has no control of programs acting on it data's only protection is DB constraints –data and procedures are structurally independent but functionally dependent

The Sun Java 2 Platform Java mantra: “write once, run anywhere” Java mantra: “write once, run anywhere” –the same code runs on any platform n also: run anytime –same code runs on the same platform over time –today on WinXP/Pentium 32bit CISC –tomorrow on Win?? & Itanium 64 bit EPIC –(this has always been OS/400 strength… 1979 S/38 *PGM objects run on current iSeries) n criticism: “write once, test/debug everywhere” –with Java 2, this is rarely an issue anymore. –with C++, it is still true

The Sun Java 2 Platform - how does it do that? n use of bytecode to achieve portability –.java source code ‘compiled’ into.class bytecode –virtual assembler language n Java Virtual Machine interprets standard bytecode and runs it on a specific platform n OS/hardware platform implements its own JVM –e.g. OS/400, Wintel, Mac, Unix, Linux –each have different Java Virtual Machines (JVM) to run standard bytecode on their local OS / hardware –some just-in-time compilation for speed –performance issues everywhere except OS/400

The Sun Java 2 JDK n terminology –JRE: Java Runtime Environment –JDK: Java Development Kit –SDK: Software Development Kit (old name for JDK) n Java compiler:> javac classfile.java n Java interpreter (JVM)> java classfile n other command-line tools (e.g. javadoc, jar) n versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5

How to install Java 2 JDK? n –link: J2SE Core Java n common problems in installation –path name (“command unknown”) –classpath name (“class file not found”) –upper/lower case names n solutions: JDK documentation, General Information, Installation Notes Installation NotesInstallation Notes n see BPJ444 web site for installation notes

How to code, compile and run a Java program? n Java 2 JDK Environment (Windows Platform) n notepad or TextPad: type in Java source code n compile source code:> javac HelloWorld.java n run program:> java HelloWorld n Eclipse: create a project, enter code (with assistance), save a file (auto compiled), run from inside Eclipse… it's an Integrated Development Environment

Getting Started with Java Programming n Two Examples: a Java application and a Java applet n The Anatomy of a Java Application n Java Applets and the Internet n The Anatomy of a Java Applet n The Java Tutorial (online): n see the Introduction web page Introduction web pageIntroduction web page

Definitions package: a group of related classes package: a group of related classes –sometimes called a "library" of classes n Java API: Application Program Interface –Java's many packages with many capabilities –all documented with javadoc utility into HTML pages n base package “java.lang” is automatically imported into every Java program

Some Examples n a Java application (console-based) application –HelloWorld.java –HelloWorld2.java –command line tools: javac, java n a Java applet applet –HelloWorldApplet.java –HelloWorlddemo2.html –tools: javac, appletviewer

The Anatomy of a Java Application n Example: HelloWorld.java n three types of comments –line, multi-line, and javadoc n keywords: public, static, private n use of API specification –names: System, out, println –package name: java.lang n the javadoc command: –> javadoc HelloWorld.java –> runJavadoc.bat (in Week01.zip) will organize and document all.java files in a directory

The Anatomy of a Java Applet a Java program that runs in a web page subject to security restrictions a Java program that runs in a web page subject to security restrictions Example: HelloWorldApplet.java Example: HelloWorldApplet.java n keyword: import use of API specification - names: java.applet.Applet, paint use of API specification - names: java.applet.Applet, paint n names: packages, classes, method, objects n tools: appletviewer, Firefox

IBM i5, iSeries, AS/400 Java Platform n Sun JDK compliant n the QShell Interpreter and Integrated File System (IFS) – simulated UNIX environment n AS/400 Toolbox for Java –Java classes developed by IBM to access OS/400 resources n performance optimization –the JVM is integrated with OS/400 in microcode –OS/400 Java commands: CRTJVAPGM, RUNJVA

Java and IBM eServer iSeries n Approach 1: use of a workstation (or desktop) n locally develop Java code, e.g. using IBM WDSC n ftp the Java code to the IBM iSeries server Integrated File System e.g. /bpj444demo n use iSeries QShell (STRQSH) to compile & run: cd /bpj444demo set CLASSPATH. javac HelloWorld2.java java HelloWorld2

Java and IBM eServer iSeries n Approach 2: Use of IBM Operations Navigator n workstation development of Java code n “drag and drop” –from Windows Explorer to Operations Navigator –use an iSeries Integrated File System directory n RIGHT click on HelloWorld2.java to compile the code n RIGHT click on HelloWorld2.class to run the code

Java and IBM eServer iSeries n Approach 3: green screen server environment n use SEU or EDTF to build Java programs n use CL commands to compile and run Java programs. e.g. ===> RUNJVA CLASS(HelloWorld2) CLASSPATH('/bpj444demo') ===> GO CMDJVA

WebSphere Development Studio Client for iSeries n build on Eclipse technology –open source IDE: n tool for developing Java, etc. code n built-in special support for OS/400 Java - AS/400 Toolbox for Java - Enterprise Toolkit for AS/400 n