advanced java new york university school of continuing and professional studies
TRANSCRIPT
![Page 1: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/1.jpg)
Advanced Java
New York University
School of Continuing and Professional Studies
![Page 2: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/2.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/3.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/4.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/6.jpg)
Feedback
Students’ Expectations From This Course
![Page 7: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/8.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/9.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/10.jpg)
10
Session 2
• Streams and File I/O
• Multithreading
![Page 11: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/11.jpg)
11
Session 3
• Collections
• Interfaces and inheritance
![Page 12: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/13.jpg)
13
Session 5
• Basic Database concepts
• Java Database Connectivity
![Page 14: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/14.jpg)
14
Session 6
• Java Servlets
• Java Server Pages
![Page 15: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/15.jpg)
15
Day 7
• RMI
• Enterprise Java Beans
• SWING
![Page 16: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/16.jpg)
16
Session 8
• AWT
• Event driven programming
![Page 17: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/17.jpg)
17
Session 9
• Java and XML
• XML and XSLT
![Page 18: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/18.jpg)
18
Session 10
• Java Native Interfaces
• Final Exam
![Page 19: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/19.jpg)
Feedback
Questions or Comments
![Page 20: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/20.jpg)
20
Java Certification
• Programmer
• Developer
• Architect
![Page 21: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/21.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/22.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/23.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/24.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/25.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/26.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/27.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/28.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/29.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/30.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/31.jpg)
31
Java Language Fundamentals
• Assignments
• Initializers
• Conversions between numeric types
![Page 32: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/32.jpg)
32
Java Language Fundamentals
• Constants
• Operators
• Operator precedence
• Expression evaluation
![Page 33: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/33.jpg)
33
Java Language Fundamentals
• Strings
• Concatenation
• Testing for equality
![Page 34: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/34.jpg)
Feedback
Questions or Comments
![Page 35: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/35.jpg)
35
Control Flow
• Statement
• Expression
• Block
• Control structure
![Page 36: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/36.jpg)
36
Conditional Statements
if (condition)
statement;
else
statement;
![Page 37: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/37.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/38.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/39.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/40.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/41.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/42.jpg)
42
Multidimensional Arrays
• Matrix
• Array of Arrays
![Page 43: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/43.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/44.jpg)
44
Objects and Classes
• Creating new objects
• Data encapsulation
![Page 45: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/45.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/46.jpg)
46
An Order Processing System
• Item
• Order
• Shipping address
• Payment
• Account
![Page 47: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/47.jpg)
47
Methods
• Order.addItem
• Order.ship
• Order.cancel
• Payment.authorize
![Page 48: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/48.jpg)
48
Relationship between Classes
• Uses
• Has-A
• Is-A
![Page 49: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/49.jpg)
49
Traditional Programming
GlobalData
function
function
function
function
![Page 50: Advanced Java New York University School of Continuing and Professional Studies](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/50.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022062304/56649e235503460f94b10bdf/html5/thumbnails/51.jpg)
51
Examples
• Card.java
• CardDeck.java
• EmployeeTest.java