COMPE 438 JAVA PROGRAMMING - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

COMPE 438 JAVA PROGRAMMING

Description:

Object-Oriented Software Development Using Java -- Principles, Patterns, and ... J2SE 1.3 (May 8, 2000), Kestrel. J2SE 1.4 (February 6, 2002), Merlin ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 26
Provided by: CEM4
Category:

less

Transcript and Presenter's Notes

Title: COMPE 438 JAVA PROGRAMMING


1
COMPE 438JAVA PROGRAMMING
  • F. Cemile Serçe

2
Syllabus
  • Course Goal
  • knowledge and skills for object-oriented
    programming using Java
  • Reference Books
  • Object-Oriented Software Development Using Java
    -- Principles, Patterns, and Frameworks, 
    Xiaoping Jia, 2ed. Addison-Wesley
  • Java How To Program 6th ed, by Deitel Deitel
  • Object-Oriented Programming in Java, by Martin
    Kalin
  • Thinking In Java, by Bruce Eckel
  • The Java Tutorial
  • many online resources

3
Syllabus
  • Class Hours
  • Thuesday- MF202 - 1130 1320
  • Wednesday- MF111 - 1130 1320
  • Lab Hours
  • 2 hours
  • 1 or more lab assignments
  • Contact Information
  • H-13
  • email cemileserce_at_gmail.com
  • Grading Strategy
  • 40 Final
  • 20 Midterm 1
  • 20 Midterm 2
  • 20 Homeworks, Labs and Quizzes

4
Syllabus
  • Content Overview
  • Introduction to Java Programming
  • What Is the Java Technology?
  • Java Development Tools and Environment
  • First Program in Java Printing a Line of Text
  • Introduction to Object-Oriented Programming and
    UML
  • Elements of Java
  • Classes and Inheritance
  • Object-Oriented Application Frameworks
  • The Collections Framework
  • The Graphical User Interfaces Framework
  • The Input/Output Framework
  • Multithreading
  • Networking
  • Accessing Database with JDBC

5
This Week
  • What Is the Java Technology?
  • Java Development Tools and Environment
  • Introduction to Object-Oriented Programming and
    UML

6
History of Java
  • Intelligent consumer-electronic devices, the
    Green Project, Sun Microsystem, 1991
  • James Gosling
  • C based language
  • Oak to Java

7
What is Java Technology?
  • Programming language
  • high-level
  • simple, object-oriented and familiar
  • architecture neutral and portable
  • high performance
  • secure
  • interpreted, threaded and dynamic.
  • Platform
  • The Java Virtual Machine
  • The Java Application Programming Interface (API)

8
How will Java Technology change your life?
  • Get started quickly
  • Write less code
  • Write better code
  • Develop programs more quickly
  • Avoid platform dependencies with 100 Pure Java
  • Write once, run anywhere
  • Distribute software more easily
  • Security

9
Java Standard Class Libraries
  • Extensive Standard Class Libraries, known as Java
    APIs (Application Programming Interfaces)
  • huge amount of libraries are built-in
  • encourage reuse concept which is central to OOP
  • improve program performance
  • available over the Intenet and the Web
  • mostly available at no charge

10
Java Standard Class Libraries
  • Out of the Box APIs
  • Graphical User Interface
  • Multithreaded Programming
  • Network Programming
  • Database Programming
  • Encryption / Digital Signatures
  • Compression
  • Input / Output
  • XML Parsing
  • Logging
  • Collections
  • Sound Playing/Recording
  • Extension APIs
  • Java Media Framework (video streaming, etc.)
  • Java Advanced Imaging API
  • Speech Synthesis
  • Telephony
  • TV

11
Program Execution Models
  • Compilation
  • Interpretation

CONVENTIONAL MODELS
COMPILE
source code
machine language
EXECUTION
INTERPRET
source code
EXECUTION
12
Java Virtual Machine (JVM)
JAVA PROGRAM EXECUTION
Java compiler
Java source code
byte-code
.class
.java
byte-code interpreter
JVM
EXECUTION
13
Basics of Java Environment
  • Java programs normally undergo three phases
  • Edit
  • Programmer writes program (and stores program on
    disk)
  • Compile
  • Compiler creates bytecodes from program
  • Run (VM)
  • Load
  • Class loader stores bytecodes in memory
  • Verify
  • Verifier ensures bytecodes do not violate
    security requirements
  • Execute
  • Interpreter translates bytecodes into machine
    language

14
First Program in Java Printing a Line of Text
Program Source Code
Program Output
Hello World
15
Compiling the Program
  • Open a command prompt window, go to directory
    where program is stored
  • Type javac HelloWorld.java
  • If no errors, HelloWorld.class created
  • Has bytecodes that represent application
  • Bytecodes passed to Java interpreter

16
Executing the Program
  • Type java HelloWorld
  • Interpreter loads .class file for class
    HelloWorld
  • .class extension omitted from command
  • Interpreter calls method main

17
JAVA DEVELOPMENT TOOLSAND ENVIRONMENT
18
JDK and JRE
  • Java Runtime Environment (JRE)
  • Java Development Kit (JDK)
  • JDK Versions
  • JDK 1.0 (January 23, 1996)
  • JDK 1.1 (February 19, 1997)
  • J2SE 1.2 (December 8, 1998), Playground
  • J2SE 1.3 (May 8, 2000), Kestrel
  • J2SE 1.4 (February 6, 2002), Merlin
  • J2SE 5.0 (September 30, 2004), Tiger
  • Java SE 6 (December 11, 2006), Mustang
  • Java SE 7 (Estimates 2008), Dolphin

19
JDK and JRE
  • Java Standard Edition (J2SE)
  • J2SE can be used to develop client-side
    standalone applications or applets.
  • Java Enterprise Edition (J2EE)
  • J2EE can be used to develop server-side
    applications such as Java servlets and Java
    ServerPages.
  • Java Micro Edition (J2ME).
  • J2ME can be used to develop applications for
    mobile devices such as cell phones

20
IDE
  • a number of free and commercial IDEs
  • Eclipse
  • An Integrated Development Environment
  • Open source
  • Powerful plugin mechanism
  • Provides many features to ease Java programming
    (and others, e.g. C/C)
  • Editor
  • Debugger
  • Source Control

21
Getting Eclipse
  • Download the latest version at
  • http//www.eclipse.org/
  • You may need to install Java SDK1.6 or JRE

22
Installing and Running Eclipse
  • Installation is very simple
  • Just unpack the downloaded package
  • Running Eclipse
  • Then click eclipse.exe
  • Eclipse will start running if all the
    prerequisites are met

DEMO
23
Setting up your workspace
  • Workspace is where your projects and programs are
    stored.
  • Usually some directory in the file system
  • The workspace is set when Eclipse starts
  • All code will be saved in this directory

DEMO
24
Creating Java Projects
  • Demo Creating a project for lecture1 in the
    workspace

DEMO
25
Running the code
  • Creating java packages
  • Adding Java Classes
  • Demo Running the code

DEMO
Write a Comment
User Comments (0)
About PowerShow.com