Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and...
-
Upload
jeremy-baldwin -
Category
Documents
-
view
228 -
download
2
Transcript of Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and...
![Page 1: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/1.jpg)
Java Programming, 2EIntroductory Concepts
and Techniques
Chapter 1An Introduction to
Java and Program Design
![Page 2: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/2.jpg)
2Chapter 1: An Introduction to Java and Program Design
Object-Oriented Programming
• Data and the operations on the data are packaged into a unit
• An interface of properties and functions is exposed to the outside world
![Page 3: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/3.jpg)
3Chapter 1: An Introduction to Java and Program Design
Classes
• Specifications of data and operationsClass rectangle
{
int length;
int width;
int size();
int perimeter();
}
![Page 4: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/4.jpg)
4Chapter 1: An Introduction to Java and Program Design
Objects
• An object is an instance of a class• A real entity that exists in the system
– Take up a block of memory
• Many objects of the same class can exist at the same timeTwo rectangle objects: rect1, rect2rect1.length != rect2.lengthrect1.width != rect2.widthrect1.size() != rect2.size()
![Page 5: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/5.jpg)
5Chapter 1: An Introduction to Java and Program Design
Java
• Designed and developed by Sun Microsystems in the early 1990’s
• One of the most widely used object-oriented programming languages
![Page 6: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/6.jpg)
6Chapter 1: An Introduction to Java and Program Design
Characteristics of Java
• Portable– Platform-independent– “write once, use everywhere”
• Secure– Protection against misuse of code
• Robust– Strongly typed and incorruptible data
![Page 7: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/7.jpg)
7Chapter 1: An Introduction to Java and Program Design
Java Program Types
• Console and Windowed applications
• Applets
• Servlets
• Web Services
• JavaBeans
![Page 8: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/8.jpg)
8Chapter 1: An Introduction to Java and Program Design
Console Applications
• Stand-alone programs using a command-line interface
![Page 9: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/9.jpg)
9Chapter 1: An Introduction to Java and Program Design
Windowed Applications
• Stand-alone programs using a graphical user interface (GUI)
![Page 10: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/10.jpg)
10Chapter 1: An Introduction to Java and Program Design
Applets
• Client-side programs executed within a Web browser
![Page 11: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/11.jpg)
11Chapter 1: An Introduction to Java and Program Design
Servlets
• Server-side programs hosted and run on a Web server
• Used in conjunction with Java Server Pages (JSP) to provide sophisticated server-side logic
• Enable connections to databases through Java Database Connectivity (JDBC)
![Page 12: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/12.jpg)
12Chapter 1: An Introduction to Java and Program Design
Servlets
![Page 13: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/13.jpg)
13Chapter 1: An Introduction to Java and Program Design
Web Services
• Services receive information requests over the Web and return the requested data
![Page 14: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/14.jpg)
14Chapter 1: An Introduction to Java and Program Design
JavaBeans• Reusable software components
![Page 15: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/15.jpg)
15Chapter 1: An Introduction to Java and Program Design
Java Program Development Using J2SE• The Java Compiler
– Converts code into bytecode
• The Java Virtual Machine – Contains an interpreter to execute the bytecode
• The Java API– The standard set of packages available in Java
• The Java Applet Viewer– Mini browser to display Java applets
![Page 16: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/16.jpg)
16Chapter 1: An Introduction to Java and Program Design
Java Program Development Using J2SE• The Java Compiler
– Converts code into bytecode
• The Java Virtual Machine – Contains an interpreter to execute the bytecode
• The Java API– The standard set of packages available in Java
• The Java Applet Viewer– Mini browser to display Java applets
• Enter Java source code using any text-editor
![Page 17: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/17.jpg)
17Chapter 1: An Introduction to Java and Program Design
Summary
• Classes & Objects
• Characteristics of Java
• Java program types
• Java program development
![Page 18: Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.](https://reader030.fdocuments.net/reader030/viewer/2022032612/56649ed95503460f94be8741/html5/thumbnails/18.jpg)
18Chapter 1: An Introduction to Java and Program Design
For Your Interests
• Java Technology: The Early Years