1. Trang chủ
  2. » Công Nghệ Thông Tin

Web Programming with Java - Introduction to Java docx

20 420 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 20
Dung lượng 565,75 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Web Programming with JavaIntroduction to Java Huynh Huu Viet Email: viethh@uit.edu.vn Department of Information Systems... What is Java?™ An object-oriented programming language develope

Trang 1

Web Programming with Java

Introduction to Java

Huynh Huu Viet Email: viethh@uit.edu.vn

Department of Information Systems

Trang 2

™ What is Java?

ƒ A little bit history

ƒ Major features

™ Where Java is used?

™ Key terms

™ A Simple Java Program

™ IDE: NetBeans

™ Resources

™ Discussion

Trang 3

What is Java?

™ An object-oriented programming language developed by Sun Microsystems

™ Also a platform to support Java applications (technology)

™ A little bit history

ƒ 1991: A team led by James Gosling at Sun

Microsystems developed Oak, for use in embedded consumer electronic appliances

ƒ 1995: renamed Java - redesigned for developing

Internet applications (Java 1.0 1.1).

ƒ 1998: Sun announced the Java 2 platform

(1.2,1.3,1.4)

ƒ 2005 - Now: Java 5 (Java 1.5 - newest version 1.7)

Trang 4

Java major features (1)

™ Simple

ƒ A bit easier C++.

ƒ The clean syntax

™ Object-Oriented

ƒ Reuse code

™ Distributed

ƒ Designed to make distributed computing easy

ƒ Writing network programs as sending and receiving data to and from a file.

™ Secure:

ƒ Based on the premise that nothing should be trusted.

Trang 5

Java major features (2)

™ Platform-independent

ƒ One program that will run on any platform with JVM

™ Portable

without being recompiled

™ Multithreaded

ƒ Program’s capability to perform several tasks simultaneously.

ƒ A necessity in multimedia and network

programming

Trang 6

Where Java is used?

™ Desktop standalone applications

™ Web applications

ƒ Client side: applets

ƒ Server side: Java servlets or JavaServer

Pages (JSP)

™ Embedded applications for small

hand-held devices

Trang 7

Key terms(1)

™ Java language specification (JLS):

ƒ Syntax and semantics of the Java programming

language

™ Java API

ƒ Predefined classes and interfaces for developing

Java programs

ƒ JLS is stable, but the API is still expanding

™ Java API – 3 Editions

ƒ Java 2 Standard Edition (J2SE): develop client-side standalone applications or applets

ƒ Java 2 Enterprise Edition (J2EE): develop server-side applications: Java servlets and JavaServer Pages

ƒ Java 2 Micro Edition (J2ME): develop applications for mobile devices

Trang 8

Key terms(2)

™ JDK- Java Development Kit ( SDK -System

Development Kit)

ƒ Programs for developing and testing Java programs

™ JRE - Java Runtime Environment

ƒ Programs for running Java programs

ƒ Includes: interpreter, core classes, and supporting files

ƒ A subset of JDK

™ IDE- Integrated Development Environment

ƒ Java development tool for rapidly developing Java programs

ƒ Three major IDE:

• JBuilder by Borland ( http://www.borland.com/ )

• NetBeans Open Source by Sun ( http://www.netbeans.org/ )

• Eclipse Open Source by IBM ( http://www.eclipse.org/ )

Trang 9

Key terms(3)

Trang 10

A Simple Java Program(1)

Trang 11

A Simple Java Program(2)

Trang 12

Anatomy of a Java Program

™ Comments

™ Reserved words

™ Modifiers

™ Statements

™ Blocks

™ Classes

™ Methods

™ The main method

Trang 13

Anatomy of a Java Program(1)

™ Comments

ƒ Line comment: //

ƒ Paragraph comment : /*…*/

™ Reserved words or keywords

ƒ Have a specific meaning to the compiler: class, public…

ƒ Java is case-sensitive

™ Modifiers

ƒ Keywords that specify the properties of the data,

methods, and classes and how they can be used.

ƒ public, static, private, final, abstract, and protected

™ Statements

ƒ Represents an action or a sequence of actions.

Trang 14

Anatomy of a Java Program(2)

™ Blocks

ƒ Begins with an opening brace ({)

ƒ Ends with a closing brace (})

™ Classes

ƒ The essential Java construct

ƒ Java program is classes

™ Methods:

ƒ Consists of a collection of statements that perform a sequence of operations

™ The main method

ƒ Defines where the program execution begins

Trang 15

Netbeans (1)

Trang 16

Netbeans (2)

™ Sun’s free, open source IDE for Java

™ Written in Java, available on any

platform that Java is available on

™ Supports plugins for working in other languages as well, such as C and C++.

™ Current Version

™ Available: http://www.netbeans.org

Trang 17

Netbeans (3)

Trang 18

™ JDK 6:

ƒ http://java.sun.com/javase/downloads/index.jsp

™ Java API (chm format):

ƒ http://www.allimant.org/javadoc/index.php

™ Netbeans IDE:

ƒ http://www.netbeans.org/index.html

™ Text Books:

sub-forum

Trang 19

Readings & Exercise

™ Further Readings

ƒ Chapter 1 [1], Chapter 2 [3]

™ Exercises:

ƒ [1]: 1.1

ƒ [3]: 2.14

™ Next week readings:

ƒ [1]: Chapter 2,3,4

Trang 20

Discussion

Ngày đăng: 27/06/2014, 21:20

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN