Advanced Java New York University School of Continuing and Professional Studies.

51
Advanced Java New York University School of Continuing and Professional Studies

Transcript of Advanced Java New York University School of Continuing and Professional Studies.

Page 1: Advanced Java New York University School of Continuing and Professional Studies.

Advanced Java

New York University

School of Continuing and Professional Studies

Page 2: Advanced Java New York University School of Continuing and Professional Studies.

2

Language of the Future

• By the year 2005 all software applications will be web based.

• Most, if not all of those will be written in Java.

• “Write once run everywhere”

Page 3: Advanced Java New York University School of Continuing and Professional Studies.

3

Course Objectives

• Train students in writing java programs – including applets.

• Enhance understanding and knowledge of java APIs and frameworks.

• Prepare students for sun’s java certification programs.

• Provide resources and support to help students achieve their career objectives.

Page 4: Advanced Java New York University School of Continuing and Professional Studies.

4

Prerequisites

• Basic knowledge of computers.

• Familiarity with any plain text editor (like notepad).

• Working in command line mode.

• Java language Fundamentals

• Ability to write, compile and run a basic Java program and applet

Page 5: Advanced Java New York University School of Continuing and Professional Studies.

5

Useful but Not Required

• Knowledge of or experience with C++

• Basic concepts of Object Oriented Design and Programming.

• Knowledge of HTML.

• Knowledge of Database concepts and familiarity with SQL

Page 6: Advanced Java New York University School of Continuing and Professional Studies.

Feedback

Students’ Expectations From This Course

Page 7: Advanced Java New York University School of Continuing and Professional Studies.

7

Agenda

• Every Tuesday/Wednesday evening from 6:20 PM to 9:20 PM - Prefer 6 pm to 9 pm if all students agree, and if the time is not invonvenient for anyone.

• For every 3 hours of lecture, student is expected to do “hands on” for at least 3 hours.

Page 8: Advanced Java New York University School of Continuing and Professional Studies.

8

Overview • Focus on Object Oriented Design and

Development using Java.

• Coverage of latest technologies in Web Applications development

Threads, Applets

JDBC,RMI,EJBs

Servlets, JSPs, Beans, XML

StreamsFilesI/IO

AWT,Events

Lists, Vectors,Sockets

Objects and Classes

Java Libraries,OOD, OOP

LanguageFundamentals

Page 9: Advanced Java New York University School of Continuing and Professional Studies.

9

Session 1

• Java certification overview

• Introduction to programming and java

• First java program

• First java applet

• Language Fundamentals

Page 10: Advanced Java New York University School of Continuing and Professional Studies.

10

Session 2

• Streams and File I/O

• Multithreading

Page 11: Advanced Java New York University School of Continuing and Professional Studies.

11

Session 3

• Collections

• Interfaces and inheritance

Page 12: Advanced Java New York University School of Continuing and Professional Studies.

12

Session 4

• Concepts in Socket Programming

• Java Network Programming

• Implementing Socket based clients and servers in Java

• Java Beans

Page 13: Advanced Java New York University School of Continuing and Professional Studies.

13

Session 5

• Basic Database concepts

• Java Database Connectivity

Page 14: Advanced Java New York University School of Continuing and Professional Studies.

14

Session 6

• Java Servlets

• Java Server Pages

Page 15: Advanced Java New York University School of Continuing and Professional Studies.

15

Day 7

• RMI

• Enterprise Java Beans

• SWING

Page 16: Advanced Java New York University School of Continuing and Professional Studies.

16

Session 8

• AWT

• Event driven programming

Page 17: Advanced Java New York University School of Continuing and Professional Studies.

17

Session 9

• Java and XML

• XML and XSLT

Page 18: Advanced Java New York University School of Continuing and Professional Studies.

18

Session 10

• Java Native Interfaces

• Final Exam

Page 19: Advanced Java New York University School of Continuing and Professional Studies.

Feedback

Questions or Comments

Page 20: Advanced Java New York University School of Continuing and Professional Studies.

20

Java Certification

• Programmer

• Developer

• Architect

Page 21: Advanced Java New York University School of Continuing and Professional Studies.

21

Sun Certified Programmer for Java 2 Platform

Exam number: 310-025

Exam type: multiple choice/short answer

No of questions: approximately 59

Pass score: 61%

Test time: 2 hours

Page 22: Advanced Java New York University School of Continuing and Professional Studies.

22

Sun Certified Developer for Java 2 Platform

Exam Number: 310-027

Exam Type: Code Example and Instructions

Pass Score: 80%

Test Time: Limited to life of the program.

Page 23: Advanced Java New York University School of Continuing and Professional Studies.

23

Sun Certified Architect forJava 2 Platform

Exam Number: 310-050

Exam Type: multiple choice/short answer

No. of Questions: approximately 60

Pass Score: 75%

Test Time: 2 hours

Page 24: Advanced Java New York University School of Continuing and Professional Studies.

24

Exam Registration

Exam if offered by sylvan Prometric

Http://www.sylvanprometric.Com

Page 25: Advanced Java New York University School of Continuing and Professional Studies.

25

Introduction to Java

• Language

• Programming Tool

• Virtual Machine Environment

• Framework of Classes/Interfaces

Page 26: Advanced Java New York University School of Continuing and Professional Studies.

26

Advantages of Java

• Simple• Portable• Object oriented• Interpreted• Distributed• Architecture neutral

• High performance• Robust• Multithreaded• Secure• Dynamic• Quick development

Page 27: Advanced Java New York University School of Continuing and Professional Studies.

27

First Java Program

• Source Code Example – Welcome.java

• Compiling and Running the first Java program– Create the program source file– Compile it using javac

C:>javac Welcome.java

– Run it using java C:>java Welcome

Page 28: Advanced Java New York University School of Continuing and Professional Studies.

28

Parts of a Java program

• Class name

• The “main” method

• Variable declarations

• Assignment statements

• Program instructions

• Calls to other methods of other classes

Page 29: Advanced Java New York University School of Continuing and Professional Studies.

29

Java Applets

• Java code

• HTML code

• Flavours of applets

• Applet example

• Running applets

Page 30: Advanced Java New York University School of Continuing and Professional Studies.

30

Java Language Fundamentals

• Comments

• Data types

• Variables

• Reserved words (Java keywords)

Page 31: Advanced Java New York University School of Continuing and Professional Studies.

31

Java Language Fundamentals

• Assignments

• Initializers

• Conversions between numeric types

Page 32: Advanced Java New York University School of Continuing and Professional Studies.

32

Java Language Fundamentals

• Constants

• Operators

• Operator precedence

• Expression evaluation

Page 33: Advanced Java New York University School of Continuing and Professional Studies.

33

Java Language Fundamentals

• Strings

• Concatenation

• Testing for equality

Page 34: Advanced Java New York University School of Continuing and Professional Studies.

Feedback

Questions or Comments

Page 35: Advanced Java New York University School of Continuing and Professional Studies.

35

Control Flow

• Statement

• Expression

• Block

• Control structure

Page 36: Advanced Java New York University School of Continuing and Professional Studies.

36

Conditional Statements

if (condition)

statement;

else

statement;

Page 37: Advanced Java New York University School of Continuing and Professional Studies.

37

Loops

while ( condition )

statement;

for ( int i = 0; i < 5; i++ )

statement;

Page 38: Advanced Java New York University School of Continuing and Professional Studies.

38

Multiple Selections

switch ( variable )

{

case <constant>: statement;

break;

case <constant>: statement;

break;

default: statement;

}

Page 39: Advanced Java New York University School of Continuing and Professional Studies.

39

Class Methods

Program components – or functions

Must be inside a class definition

Page 40: Advanced Java New York University School of Continuing and Professional Studies.

40

Arrays

• Arrays are Objects in Java

• Creating an array

• Initializing an array

• Copying an array

Page 41: Advanced Java New York University School of Continuing and Professional Studies.

41

Arrays

• Arrays may be passed to methods

• Arrays may be returned from methods

Page 42: Advanced Java New York University School of Continuing and Professional Studies.

42

Multidimensional Arrays

• Matrix

• Array of Arrays

Page 43: Advanced Java New York University School of Continuing and Professional Studies.

43

Objects and Classes

• A class is a “template” or a “blueprint”

• Objects are the “cookies” or “buildings”

Page 44: Advanced Java New York University School of Continuing and Professional Studies.

44

Objects and Classes

• Creating new objects

• Data encapsulation

Page 45: Advanced Java New York University School of Continuing and Professional Studies.

45

Objects

• Black-box approach

• Object’s behavior

• Object’s state

• Object’s identity

• Instances of a class

Page 46: Advanced Java New York University School of Continuing and Professional Studies.

46

An Order Processing System

• Item

• Order

• Shipping address

• Payment

• Account

Page 47: Advanced Java New York University School of Continuing and Professional Studies.

47

Methods

• Order.addItem

• Order.ship

• Order.cancel

• Payment.authorize

Page 48: Advanced Java New York University School of Continuing and Professional Studies.

48

Relationship between Classes

• Uses

• Has-A

• Is-A

Page 49: Advanced Java New York University School of Continuing and Professional Studies.

49

Traditional Programming

GlobalData

function

function

function

function

Page 50: Advanced Java New York University School of Continuing and Professional Studies.

50

Object Oriented Programming

Object 1

Object 3

Object 2

method

method

method

method

Page 51: Advanced Java New York University School of Continuing and Professional Studies.

51

Examples

• Card.java

• CardDeck.java

• EmployeeTest.java