Introduction to Java Programming / Edition 9

Other Format (Print)
Rent
Rent from BN.com
$48.14
(Save 59%)
Est. Return Date: 10/19/2014
Used and New from Other Sellers
Used and New from Other Sellers
from $26.74
Usually ships in 1-2 business days
(Save 76%)
Other sellers (Other Format)
  • All (8) from $26.74   
  • New (5) from $26.74   
  • Used (3) from $40.60   

Overview

ALERT: Before you purchase, check with your instructor or review your course syllabus to ensure that you select the correct ISBN. Several versions of Pearson's MyLab & Mastering products exist for each title, including customized versions for individual schools, and registrations are not transferable. In addition, you may need a CourseID, provided by your instructor, to register for and use Pearson's MyLab & Mastering products.

Packages

Access codes for Pearson's MyLab & Mastering products may not be included when purchasing or renting from companies other than Pearson; check with the seller before completing your purchase.

Used or rental books

If you rent or purchase a used book with an access code, the access code may have been redeemed previously and you may have to purchase a new access code.

Access codes

Access codes that are purchased from sellers other than Pearson carry a higher risk of being either the wrong ISBN or a previously redeemed code. Check with the seller prior to purchase.

--

Read More Show Less

Editorial Reviews

From the Publisher
“All the topics and concepts are clearly explained with examples and tips to remember with side texts.” — Syed Riaz Ahmed, North Georgia College and State University

“The first, best feature of this text is the rich set of clear example code provided — which are located in concise textual explanations well-suited for the modern undergraduate. In addition, the wide coverage of material makes this book suitable for several courses. For an undergraduate student, it is a true “keeper”.” — Frank Ducrest, University of Louisiana — Lafayette

“One book [Liang] for ALL Java courses.” — Maureen Opkins, California State University — Long Beach

“The thorough nature of this text [Liang] should be stressed; it has utility as a reference far after the course is over.” — Dale Parson, Kutztown University of Pennsylvania

“The interactive and animated online support for this text [Liang] will help students realize how Java syntax evolves into a Java program, which, in turn, executes.” — Barbara Guillott, Louisiana State University

Read More Show Less

Product Details

  • ISBN-13: 9780132991704
  • Publisher: Prentice Hall
  • Publication date: 3/5/2012
  • Edition description: Student
  • Edition number: 9
  • Pages: 1368
  • Product dimensions: 3.00 (w) x 8.70 (h) x 0.30 (d)

Meet the Author

Dr. Liang earned his Ph.D. in Computer Science from the University of Okalahoma in 1991, and an MS and BS in Computer Science from Fudan University in Shanghai, China, in 1986 and 1983. Prior to joining Armstrong, he was an associate professor in computer science at Purdue University in Fort Wayne, where he twice received the Excellence in Research award.

Dr. Liang was trained in theoretical computer science. He was active in graph algorithms from 1990 to 1995 and published more than ten papers in several established journals such as SIAM Journal on Computing, Discrete Applied Mathematics, Acta Informatics, and Information Processing Letters. Since 1996, he has devoted to writing texts and published more than thirty books with Prentice Hall. His popular computer science texts are widely adopted in the world.

Dr. Liang was elected a Java Champion in 2005 by Sun Microsystems. He has given lectures on Java internationally.

Read More Show Less

Read an Excerpt

PREFACE:

PREFACE

To the Instructor

There are three popular strategies in teaching Java. The first is to mix Java applets and graphics programming with object-oriented programming concepts. The second is to introduce object-oriented programming from the start. The third strategy is a step-by-step approach, first laying a sound foundation on programming concepts, control statements, and methods, then introducing object-oriented programming, and finally moving on to graphical user interface (GUI), applets, internationalization, multithreading, multimedia, I/O, and networking.

The first strategy, starting with GUI and applets, seems attractive, but requires substantial knowledge of object-oriented programming and a good understanding of the Java event-handling model; thus, students may never fully understand what they are doing. The second strategy is based on the notion that the objects should be introduced first because Java is an object-oriented programming language. This notion, however, does not strike a chord with students. From the more than 40 Java courses I have taught, I have concluded that introducing primary data types, control structures, and methods prepares students to learn object-oriented programming. Therefore, this text adopts the third strategy, first proceeding at a steady pace through all the necessary and important basic concepts, then moving to object-oriented programming, and then to using the object-oriented approach to build interesting GUI applications and applets with multithreading, multimedia, I/O, and networking.

The book is suited for both beginning and advanced students, depending on how it is used. Thisbook has been used in a two-semester freshman programming course and a one-semester course in Java as a second language. It has also been used for a short training course for experienced programmers. Computer science departments, engineering departments, and management information systems departments around the world have used this book at various levels. For students with no programming experience, the emphasis should be on Part I of the book, particularly on writing the loops. You could spend the entire semester of four credit hours just on the first six chapters of the book.

The Instructor's Manual on CD-ROM is available for instructors using this book. It contains the following resources:

  • Microsoft PowerPoint slides for lectures.
  • Answers to review questions.
  • Source code for the examples in the book.
  • The new edition provides 45% more programming exercises. Instructor's Solutions are provided in the Instructor's Manual. Students will have access to the solutions of even-numbered exercises.
  • Over 450 multiple-choice and true-or-false questions and answers covering all of the chapters of the book in sequence. These questions can be used in the exams or as additional review questions.

To obtain the Instructor's Manual, contact your Prentice-Hall sales representative.

Microsoft PowerPoint slides, answers to review questions, solutions to even-numbered programming exercises, and source code for the examples in the book are also available at the book's companion Web site at www.cs.armstrong.edu/liang/intro3e.html and www.prenhall.com/liang

Pedagogical Features of the Book

Introduction to Java Programming Third Edition uses the following elements to get the most out of the material:

  • Objectives lists what students should have learned from the chapter. This will help them to determine whether they have met the objectives after completing the chapter.
  • Introduction opens the discussion with a-brief overview of what to expect from the chapter.
  • Programming concepts are taught by representative Examples, carefully chosen and presented in an easy-to-follow style. Each example is described, and includes the source code, a sample run, and an example review. The source code of the examples is contained in the companion CD-ROM.
  • Each program is complete and ready to be compiled and executed. The sample run of the program is captured from the screen to give students a live presentation of the example. Reading these examples is much like entering and running them on a computer.
  • Chapter Summary reviews the important subjects that students should understand and remember. It helps them to reinforce the key concepts they have learned in the chapter.
  • Review Questions help students to track their progress and evaluate their learning.
  • Programming Exercises at the end of each chapter provide students with opportunities to apply the skills on their own. The trick of learning programming is practice, practice, and practice. To that end, the book provides a large number of exercises.
  • Notes and Tips are inserted throughout the text to offer valuable advice and insight on important aspects of program development.
    – NOTE: Provides additional information on the subject and reinforces important concepts.
    – TIP: Teaches good programming style and practice, and helps students steer away from the pitfalls of programming errors.

What's New in This Edition

This book expands and improves upon the second edition of Introduction to Java Programming. The major changes are as follows:

  • The use of UML enhances the treatment of object-oriented design and programming. UML graphical notations are used to describe classes and their relationships throughout the book.
  • Beginning with Chapter 8, "Getting Started with Graphics Programming," all the AWT user interface components are replaced with state-of-the-art Swing components.
  • Chapter 12, "Internationalization," is brand-new. It introduces date, time, and number formatting, and the development of Java programs for international audiences.
  • Several new case studies are provided to give more examples for learning the fundamentals of programming, such as writing loops.
  • Nonessential sections are marked optional and can be skipped or covered later with no adverse effect on the students' understanding of subsequent chapters. These sections include such topics as recursion, advanced layout managers, and resource bundles.
  • Several new appendices provide readers with additional background information.

To the Student

There is nothing more important to the future of computing than the Internet. There is nothing more exciting on the Internet than Java. A revolutionary programming language developed by Sun Microsystems, Java has become the de facto standard for cross-platform applications and programming on the World Wide Web.

Before Java, the Web was used primarily for viewing static information on the Internet using HTML, a marked-up language for document layout and for linking documents over the Internet. Java programs can be embedded in an HTML page and downloaded by Web browsers to bring live animation and interactive applications to Web clients.

Java is a full-featured, general-purpose programming language that is capable of developing robust mission-critical applications. In the last three years, Java has gained enormous popularity and has quickly become the most popular and successful programming language. Today, it is used not only for Web programming, but also for developing standalone applications. Many companies that once considered Java to be more hype than substance are now using it to create distributed applications accessed by customers and partners across the Internet. For every new project being developed today, companies are asking how they can use Java to make their work easier.

Java's Design and Advantages

Java is an object-oriented programming language. Object-oriented programming is a favored programming approach that has replaced traditional procedure-based programming techniques. An object-oriented language uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability for developing software.

Java is platform-independent. Its programs can run on any platform with a Java Virtual Machine, a software component that interprets Java instructions and carries out associated actions.

Java is distributed. Networking is inherently built-in. Simultaneous processing can occur on multiple computers on the Internet. Writing network programs is treated as simple data input and output.

Java is multithreaded. Multithreading is the capability of a program to perform several tasks simultaneously, such as downloading a video file while playing the video at the same time. Multithreading is particularly useful in graphical user interfaces (GUI) and network programming. Multithread programming is smoothly integrated in Java. In other languages, you can only enable multithreading by calling procedures that are specific to the operating system.

Java is secure. Computers become vulnerable when they are connected with other computers. Viruses and malicious programs can damage your computer. Java is designed with multiple layers of security that ensure proper access to private data and restrict access to disk files.

Java's Versatility

Stimulated by the promise of writing programs once and running them anywhere, Java has become the most important programming language. IBM, Sun, and Apple, and many other vendors are working to integrate the Java Virtual Machine with their operating systems so that Java programs can run directly and efficiently on the native machine. Java programs run on full-featured computers, and also on consumer electronics and appliances.

Because of its great potential to unite existing legacy applications written on different platforms so that they can run together, Java has been perceived as a universal front end for the enterprise database. The leading database companies, IBM, Oracle, Sybase, and Informix, have extended their commitment to Java by integrating it into their products. Oracle, for example, enables Java applications to run on its server, and to deliver a complete set of Java-based development tools supporting the integration of current applications with the Web.

Learning Java

To the first time programmers, learning Java is like learning any high-level programming languages. The fundamentals of learning programming is to develop critical skills of formulating programmatic solutions for the programs and to translate the solutions into programs using the selection statements, loops, and methods.

Applying the concept of abstraction in the design and implementation of software projects is the key to developing software. The overriding objective of this book, therefore, is to teach students to use many levels of abstraction in solving problems and to see problems in small and in large.

Students with no programming experience should take a slow-pace approach in Part I of the book. I recommend you to complete all the exercises in Chapter 3 and 4 before moving to Chapter 5. Students new to object-oriented programming may need some time to become familiar with the concept of objects and classes. Once the principles are mastered, programming in Java is easy and productive. Students who know object-oriented programming languages like C++ and Smalltalk will find it easier to learn Java. In fact, they will find that Java is simpler than C++ and Smalltalk in many aspects.

Organization of the Book

This book is divided into four parts that, taken together, form a comprehensive introductory course on Java programming. Because knowledge is cumulative, the early chapters provide the conceptual basis for understanding Java and guide students through simple examples and exercises; subsequent chapters progressively present Java programming in detail, culminating with the development of comprehensive Java applications. The appendixes contain a mixed bag of topics, including an HTML tutorial.

Part I: Fundamentals of Programming

The first part of the book is a stepping stone that will prepare you to embark on the journey of learning Java. You will begin to know Java, and will learn how to write simple Java programs with primitive data types, control statements, and methods.

Chapter 1, "Introduction to Java," gives an overview of the major features of Java: object-oriented programming, platform-independence, Java bytecode, security, performance, multithreading, and networking. The chapter also introduces how to create, compile, and run Java applications and applets. Simple examples of writing applications and applets are provided, along with a brief anatomy of programming structures.

Chapter 2, "Primitive Data Types and Operations," introduces primitive data types, operators, and expressions. Important topics include identifiers, variables, constants, assignment statements, primitive data types, operators, and shortcut operators. Java programming style and documentation are also addressed.

Chapter 3, "Control Statements," introduces decision and repetition statements. Java decision statements include various forms of if statements, and the switch statement. Java repetition statements include the while loop, the do loop, and the for loop. The keywords break and continue are discussed.

Chapter 4, "Methods," introduces method creation, calling methods, passing parameters, returning values, method overloading, and recursion. Applying the concept of abstraction is the key to developing software. The chapter also introduces the use of method abstraction in problem-solving. The math class for performing basic math operations is introduced.

Part II: Object-Oriented Programming

In the book's second part, object-oriented programming is introduced. Java is a class-centric, object-oriented programming language that uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability in developing software. You will learn programming with objects and classes, arrays and strings, and class inheritance.

Chapter 5, "Programming with Objects and Classes," begins with objects and classes. The important topics include defining classes, creating objects, using constructors, passing objects to methods, instance and class variables, and instance and class methods, analyzing relationships among classes, and using the UML graphical notations to describe classes. Several examples are provided to demonstrate the power of the object-oriented programming approach. Students will learn the benefits (abstraction, encapsulation, and modularity) of object-oriented programming from these examples. There are more than 500 predefined Java classes grouped in several packages. Starting with this chapter, students will gradually learn how to use Java classes to develop their own programs. The classes string, stringBuffer, and stringTokenizer for storing and processing strings are introduced.

Chapter 6, "Class Inheritance," teaches how an existing class can be extended and modified as needed. Inheritance is an extremely powerful programming technique, further extending software reusability. Java programs are all built by extending predefined Java classes. The major topics include defining subclasses, using the keywords super and this, using the modifiers protected, final and abstract, polymorphism and dynamic binding, and casting objects. This chapter introduces the object class, which is the root of all Java classes. You will learn to use abstract classes, and interfaces.

Chapter 7, "Arrays and Vectors," explores an important structure: arrays for processing data in lists and tables. You will learn how to declare, initialize, and copy arrays. You will also learn how to use wrapper classes to encapsulate primitive data type values in objects for use in generic programming. This chapter introduces the vector class, which can be used to store an unspecified number of elements.

Part III: Graphics Programming

The third part of the book introduces Java graphics programming. Major topics include event-driven programming, creating graphical user interfaces, and writing applets. You will learn the architecture of Java graphics programming API and use the user interface components to develop graphics applications and applets.

Chapter 8, "Getting Started with Graphics Programming," introduces the concepts of Java graphics programming using Swing components. Topics include the Swing class hierarchy, event-driven programming, frames, panels, and simple layout managers (F1owLayout, GridLayout, and BorderLayout). The chapter also introduces drawing geometric figures in the graphics context.

Chapter 9, "Creating User Interfaces," introduces the user interface components: buttons, labels, text fields, text areas, combo boxes, lists, check boxes, radio buttons, menus, scrollbars, and scroll panes. Today's client/server and Web-based applications use a graphical user interface (GUI, pronounced "goo-ee"). Java has a rich set of classes to help you build GUIs.

Chapter 10, "Applets and Advanced Graphics," takes an in-depth look at applets, discussing applet behavior and the relationship between applets and other Swing classes. Applets are a special kind of Java class that can be executed from the Web browser. Students will learn how to convert applications to applets, and vice versa, and how to run programs both as applications and as applets. The chapter also introduces two advanced layout mangers (cardLayout and GridBagLayout) and the use of no layout. Advanced examples of handling mouse and keyboard events are provided. You will learn how to package and deploy Java applications and applets.

Part IV: Developing Comprehensive Projects

The book's final part is devoted to several advanced features of Java programming. You will learn how to use these features to develop comprehensive programs; for example, using exception handling to make your program robust, using multithreading to make your program more responsive and interactive, incorporating sound and images to make your program user-friendly, using input and output to manage and process a large quantity of data, and creating client/server applications with Java networking support.

Chapter 11, "Exception Handling," teaches students how to define exceptions, throw exceptions, and handle exceptions so that their programs can either continue to run or terminate gracefully in the event of runtime errors. The chapter discusses predefined exception classes, and gives examples of creating user-defined exception classes.

Chapter 12, "Internationalization," introduces the development of Java programs for international audiences. You will learn how to format dates, numbers, currencies, and percentages for different regions, countries, and languages. You will also learn how to use resource bundles to define which images and strings are used by a component depending on the user's locale and preferences.

Chapter 13, "Multithreading," introduces threads, which enable the running of multiple tasks simultaneously in one program. Students will learn how to use the Thread class and the Runnable interface to launch separate threads. The chapter also discusses thread states, thread priority, thread groups, and the synchronization of conflicting threads.

Chapter 14, "Multimedia," teaches how to incorporate sound and images to bring live animation to Java programs. Various techniques for smoothing animation are introduced.

Chapter 15, "Input and Output," introduces input and output streams. Students will learn the class structures of I/O streams, byte and character streams, file I/O streams, data I/O streams, print streams, delimited I/O, random file access, and interactive I/O.

Chapter 16, "Networking," introduces network programming. Students will learn the concept of network communication, stream sockets, client/server programming, and reading data files from the Web server.

Appendixes

This part of the book covers a mixed bag of topics. Appendix A lists Java keywords. Appendix B gives tables of ASCII characters and their associated codes in decimal and in hex. Appendix C shows the operator precedence. Appendix D summarizes Java modifiers and their usage. Appendix E introduces number systems and conversions among binary, decimal, and hex numbers. Appendix F introduces HTML basics. Appendix G lists UML Graphical Notations for describing classes and their relationships. Appendix H introduces packages for grouping classes. Appendix I gives a JBuilder 3.5 tutorial. Finally, Appendix J provides a glossary of key terms used in the text.

Read More Show Less

Table of Contents

I. FUNDAMENTALS OF PROGRAMMING.

1. Introduction to Java.
Introduction. The History of Java. Characteristics of Java. Java and the World Wide Web. The Java Language Specification. Java Development Tools. Java Applications. Anatomy of the Application Program. Java Applets (Optional). Anatomy of the Applet Program (Optional). Applications versus Applets (Optional).

2. Primitive Data Types and Operations.
Introduction. Writing Simple Programs. Identifiers. Variables. Assignment Statements. Constants. Numerical Data Types. Character Data Type. Boolean Data Type. Case Studies. Programming Style and Documentation. Programming Errors. Debugging (Optional).

3. Control Statements.
Introduction. Selection Statements. Loop Statements. Using the Keywords break and continue. Case Studies.

4. Methods.
Introduction. Creating a Method. Calling a Method. Passing Parameters. Overloading Methods. Method Abstraction. The Math Class. Case Studies. Recursion (Optional).

II. OBJECT-ORIENTED PROGRAMMING.

5. Programming with Objects and Classes.
Introduction. Objects and Classes. Constructors. Passing Objects to Methods. Visibility Modifiers and Accessor Methods. Class Variables, Constants, and Methods. The Scope of Variables. The Keyword this. Analyzing Relationships amongObjects. Case Studies. Java Application Programmer Interface. The String Class. The StringBuffer Class. The StringTokenizer Class.

6. Class Inheritance.
Introduction. Superclasses and Subclasses. Using the super Keyword. Overriding Methods. The object Class. The protected and final Modifiers. Abstract Classes. Polymorphism and Dynamic Binding. Casting Objects and the instanceof Operator. Interfaces. Inner Classes. Software Development Processes. Class-Design Guidelines.

7. Arrays and Vectors.
Introduction. Declaring and Creating Arrays. Initializing and Processing Arrays. Sorting Arrays. Searching Arrays. Array of Objects. Copying Arrays. Multidimensional Arrays. Processing Primitive Type Values as Objects. The Number Class and Its Subclasses. Command-Line Arguments. Case Studies (Optional). The Vector Class (Optional).

III. GRAPHICS PROGRAMMING.

8. Getting Started with Graphics Programming.
Introduction. The Java Graphics API. Frames. Layout Managers. Using Panels as Containers. Drawing Graphics in Panels. The Color Class. The Font and FontMetrics Classes. Drawing Geometric Figures. Case Studies. Event-Driven Programming.

9. Creating User Interfaces.
Introduction. JavaBeans. Buttons. Labels. Text Fields. Text Areas. Combo Boxes. Lists. Check Boxes. Radio Buttons. Borders. Message Dialog Boxes. Menus. Creating Multiple Windows. Scrollbars. Scroll Panes. Tabbed Panes.

10. Applets and Advanced Graphics.
Introduction. The Applet Classes. The JApplet Class. Running Applets in the Java Plug-In (Optional). The <> HTML Tag. Passing Parameters to Applets. Conversions between Applications and Applets. Running a Program as an Applet and an Application. Mouse Events. Keyboard Events. Modeling Dynamic Behavior Using Sequence Diagrams and Statecharts. Case Studies. Packaging and Deploying Java Projects (Optional). The CardLayout Manager (Optional). The GridBagLayout Manager (Optional). Using No Layout Manager (Optional).

IV. DEVELOPING COMPREHENSIVE PROJECTS.

11. Exception Handling.
Introduction. Exceptions and Exception Types. Understanding Exception Handling. Rethrowing Exceptions. The finally Clause. Cautions When Using Exceptions. Creating Custom Exception Classes (Optional).

12. Internationalization.
Introduction. The Locale Class. Processing Date and Time. Formatting Numbers. Resource Bundles (Optional).

13. Multithreading.
Introduction. Creating Threads by Extending the Thread Class. Creating Threads by Implementing the Runnable Interface. Controlling Threads and Thread States. Thread Groups. Synchronization. Creating Threads for Applets. Using the Timer Class to Control Animation. Case Studies.

14. Multimedia.
Introduction. Playing Audio. Running Audio on a Separate Thread. Displaying Images. Loading Images and Audio Files in Java Applications. Displaying a Sequence of Images. Using MediaTracker.

15. Input and Output.
Introduction. Stream Classes. The File Class and Processing External Files. Filter Streams. Data Streams. Print Streams. Buffered Streams. File Dialogs. Text Input and Output on the Console. Object Streams. Random Access Files. Parsing Text Files (Optional). Array Streams, Piped Streams, String Streams, Pushback Streams, and Line Number Streams (Optional).

16. Networking.
Introduction. Client/Server Computing. Serving Multiple Clients and the InetAddress Class. Applet Clients. Sending and Receiving Objects. The URL Class and Viewing Web Pages from Applets. Retrieving Files from Web Servers. Viewing HTML Files Using JEditorPane. Case Studies (Optional).

APPENDICES.

Appendix A: Java Keywords.
Appendix B: The ASCII Character Set.
Appendix C: Operator Precedence Chart.
Appendix D: Java Modifiers.
Appendix E: Number Systems.
Introduction. Conversions between Binary Numbers and Decimal Numbers. Conversions between Hexadecimal Numbers and Decimal Numbers. Conversions between Binary Numbers and Hexadecimal Numbers.

Appendix F: An HTML Tutorial.
Getting Started. Structure Tags. Text Appearance Tags. Paragraph-Style Tags. Font, Size, and Color Tags. List Tags. Table Tags. Hyperlink Tags. Embedding Graphics. More on HTML.

Appendix G: UML Graphical Notations.
Classes and Objects. The Modifiers, public, private, protected, and static. Class Relationships. Abstract Classes and Interfaces. Sequence Diagrams. Statechart Diagrams.

Appendix H: Packages.
Package-Naming Conventions. The Classpath Environment Variable. Putting Classes into Packages. Using Packages.

Appendix I: A JBuilder 3.5 Tutorial.
Introduction. What Is JBuilder 3.5? Obtaining and Installing JBuilder 3.5. Getting Started with JBuilder 3. Creating a Project. Setting Project Properties. Creating a Java Application. Compiling a Java Program. Executing a Java Application. Creating a Java Applet. Compiling and Viewing Applets in JBuilder 3.5. Using the MyInput Class in JBuilder 3.5. Some Known Problems of JBuilder 3.5.

Appendix J: Glossary. Index.
Read More Show Less

Preface

PREFACE:

PREFACE

To the Instructor

There are three popular strategies in teaching Java. The first is to mix Java applets and graphics programming with object-oriented programming concepts. The second is to introduce object-oriented programming from the start. The third strategy is a step-by-step approach, first laying a sound foundation on programming concepts, control statements, and methods, then introducing object-oriented programming, and finally moving on to graphical user interface (GUI), applets, internationalization, multithreading, multimedia, I/O, and networking.

The first strategy, starting with GUI and applets, seems attractive, but requires substantial knowledge of object-oriented programming and a good understanding of the Java event-handling model; thus, students may never fully understand what they are doing. The second strategy is based on the notion that the objects should be introduced first because Java is an object-oriented programming language. This notion, however, does not strike a chord with students. From the more than 40 Java courses I have taught, I have concluded that introducing primary data types, control structures, and methods prepares students to learn object-oriented programming. Therefore, this text adopts the third strategy, first proceeding at a steady pace through all the necessary and important basic concepts, then moving to object-oriented programming, and then to using the object-oriented approach to build interesting GUI applications and applets with multithreading, multimedia, I/O, and networking.

The book is suited for both beginning and advanced students, depending on how it is used.Thisbook has been used in a two-semester freshman programming course and a one-semester course in Java as a second language. It has also been used for a short training course for experienced programmers. Computer science departments, engineering departments, and management information systems departments around the world have used this book at various levels. For students with no programming experience, the emphasis should be on Part I of the book, particularly on writing the loops. You could spend the entire semester of four credit hours just on the first six chapters of the book.

The Instructor's Manual on CD-ROM is available for instructors using this book. It contains the following resources:

  • Microsoft PowerPoint slides for lectures.
  • Answers to review questions.
  • Source code for the examples in the book.
  • The new edition provides 45% more programming exercises. Instructor's Solutions are provided in the Instructor's Manual. Students will have access to the solutions of even-numbered exercises.
  • Over 450 multiple-choice and true-or-false questions and answers covering all of the chapters of the book in sequence. These questions can be used in the exams or as additional review questions.

To obtain the Instructor's Manual, contact your Prentice-Hall sales representative.

Microsoft PowerPoint slides, answers to review questions, solutions to even-numbered programming exercises, and source code for the examples in the book are also available at the book's companion Web site at www.cs.armstrong.edu/liang/intro3e.html and www.prenhall.com/liang

Pedagogical Features of the Book

Introduction to Java Programming Third Edition uses the following elements to get the most out of the material:

  • Objectives lists what students should have learned from the chapter. This will help them to determine whether they have met the objectives after completing the chapter.
  • Introduction opens the discussion with a-brief overview of what to expect from the chapter.
  • Programming concepts are taught by representative Examples, carefully chosen and presented in an easy-to-follow style. Each example is described, and includes the source code, a sample run, and an example review. The source code of the examples is contained in the companion CD-ROM.
  • Each program is complete and ready to be compiled and executed. The sample run of the program is captured from the screen to give students a live presentation of the example. Reading these examples is much like entering and running them on a computer.
  • Chapter Summary reviews the important subjects that students should understand and remember. It helps them to reinforce the key concepts they have learned in the chapter.
  • Review Questions help students to track their progress and evaluate their learning.
  • Programming Exercises at the end of each chapter provide students with opportunities to apply the skills on their own. The trick of learning programming is practice, practice, and practice. To that end, the book provides a large number of exercises.
  • Notes and Tips are inserted throughout the text to offer valuable advice and insight on important aspects of program development.
    – NOTE: Provides additional information on the subject and reinforces important concepts.
    – TIP: Teaches good programming style and practice, and helps students steer away from the pitfalls of programming errors.

What's New in This Edition

This book expands and improves upon the second edition of Introduction to Java Programming. The major changes are as follows:

  • The use of UML enhances the treatment of object-oriented design and programming. UML graphical notations are used to describe classes and their relationships throughout the book.
  • Beginning with Chapter 8, "Getting Started with Graphics Programming," all the AWT user interface components are replaced with state-of-the-art Swing components.
  • Chapter 12, "Internationalization," is brand-new. It introduces date, time, and number formatting, and the development of Java programs for international audiences.
  • Several new case studies are provided to give more examples for learning the fundamentals of programming, such as writing loops.
  • Nonessential sections are marked optional and can be skipped or covered later with no adverse effect on the students' understanding of subsequent chapters. These sections include such topics as recursion, advanced layout managers, and resource bundles.
  • Several new appendices provide readers with additional background information.

To the Student

There is nothing more important to the future of computing than the Internet. There is nothing more exciting on the Internet than Java. A revolutionary programming language developed by Sun Microsystems, Java has become the de facto standard for cross-platform applications and programming on the World Wide Web.

Before Java, the Web was used primarily for viewing static information on the Internet using HTML, a marked-up language for document layout and for linking documents over the Internet. Java programs can be embedded in an HTML page and downloaded by Web browsers to bring live animation and interactive applications to Web clients.

Java is a full-featured, general-purpose programming language that is capable of developing robust mission-critical applications. In the last three years, Java has gained enormous popularity and has quickly become the most popular and successful programming language. Today, it is used not only for Web programming, but also for developing standalone applications. Many companies that once considered Java to be more hype than substance are now using it to create distributed applications accessed by customers and partners across the Internet. For every new project being developed today, companies are asking how they can use Java to make their work easier.

Java's Design and Advantages

Java is an object-oriented programming language. Object-oriented programming is a favored programming approach that has replaced traditional procedure-based programming techniques. An object-oriented language uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability for developing software.

Java is platform-independent. Its programs can run on any platform with a Java Virtual Machine, a software component that interprets Java instructions and carries out associated actions.

Java is distributed. Networking is inherently built-in. Simultaneous processing can occur on multiple computers on the Internet. Writing network programs is treated as simple data input and output.

Java is multithreaded. Multithreading is the capability of a program to perform several tasks simultaneously, such as downloading a video file while playing the video at the same time. Multithreading is particularly useful in graphical user interfaces (GUI) and network programming. Multithread programming is smoothly integrated in Java. In other languages, you can only enable multithreading by calling procedures that are specific to the operating system.

Java is secure. Computers become vulnerable when they are connected with other computers. Viruses and malicious programs can damage your computer. Java is designed with multiple layers of security that ensure proper access to private data and restrict access to disk files.

Java's Versatility

Stimulated by the promise of writing programs once and running them anywhere, Java has become the most important programming language. IBM, Sun, and Apple, and many other vendors are working to integrate the Java Virtual Machine with their operating systems so that Java programs can run directly and efficiently on the native machine. Java programs run on full-featured computers, and also on consumer electronics and appliances.

Because of its great potential to unite existing legacy applications written on different platforms so that they can run together, Java has been perceived as a universal front end for the enterprise database. The leading database companies, IBM, Oracle, Sybase, and Informix, have extended their commitment to Java by integrating it into their products. Oracle, for example, enables Java applications to run on its server, and to deliver a complete set of Java-based development tools supporting the integration of current applications with the Web.

Learning Java

To the first time programmers, learning Java is like learning any high-level programming languages. The fundamentals of learning programming is to develop critical skills of formulating programmatic solutions for the programs and to translate the solutions into programs using the selection statements, loops, and methods.

Applying the concept of abstraction in the design and implementation of software projects is the key to developing software. The overriding objective of this book, therefore, is to teach students to use many levels of abstraction in solving problems and to see problems in small and in large.

Students with no programming experience should take a slow-pace approach in Part I of the book. I recommend you to complete all the exercises in Chapter 3 and 4 before moving to Chapter 5. Students new to object-oriented programming may need some time to become familiar with the concept of objects and classes. Once the principles are mastered, programming in Java is easy and productive. Students who know object-oriented programming languages like C++ and Smalltalk will find it easier to learn Java. In fact, they will find that Java is simpler than C++ and Smalltalk in many aspects.

Organization of the Book

This book is divided into four parts that, taken together, form a comprehensive introductory course on Java programming. Because knowledge is cumulative, the early chapters provide the conceptual basis for understanding Java and guide students through simple examples and exercises; subsequent chapters progressively present Java programming in detail, culminating with the development of comprehensive Java applications. The appendixes contain a mixed bag of topics, including an HTML tutorial.

Part I: Fundamentals of Programming

The first part of the book is a stepping stone that will prepare you to embark on the journey of learning Java. You will begin to know Java, and will learn how to write simple Java programs with primitive data types, control statements, and methods.

Chapter 1, "Introduction to Java," gives an overview of the major features of Java: object-oriented programming, platform-independence, Java bytecode, security, performance, multithreading, and networking. The chapter also introduces how to create, compile, and run Java applications and applets. Simple examples of writing applications and applets are provided, along with a brief anatomy of programming structures.

Chapter 2, "Primitive Data Types and Operations," introduces primitive data types, operators, and expressions. Important topics include identifiers, variables, constants, assignment statements, primitive data types, operators, and shortcut operators. Java programming style and documentation are also addressed.

Chapter 3, "Control Statements," introduces decision and repetition statements. Java decision statements include various forms of if statements, and the switch statement. Java repetition statements include the while loop, the do loop, and the for loop. The keywords break and continue are discussed.

Chapter 4, "Methods," introduces method creation, calling methods, passing parameters, returning values, method overloading, and recursion. Applying the concept of abstraction is the key to developing software. The chapter also introduces the use of method abstraction in problem-solving. The math class for performing basic math operations is introduced.

Part II: Object-Oriented Programming

In the book's second part, object-oriented programming is introduced. Java is a class-centric, object-oriented programming language that uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability in developing software. You will learn programming with objects and classes, arrays and strings, and class inheritance.

Chapter 5, "Programming with Objects and Classes," begins with objects and classes. The important topics include defining classes, creating objects, using constructors, passing objects to methods, instance and class variables, and instance and class methods, analyzing relationships among classes, and using the UML graphical notations to describe classes. Several examples are provided to demonstrate the power of the object-oriented programming approach. Students will learn the benefits (abstraction, encapsulation, and modularity) of object-oriented programming from these examples. There are more than 500 predefined Java classes grouped in several packages. Starting with this chapter, students will gradually learn how to use Java classes to develop their own programs. The classes string, stringBuffer, and stringTokenizer for storing and processing strings are introduced.

Chapter 6, "Class Inheritance," teaches how an existing class can be extended and modified as needed. Inheritance is an extremely powerful programming technique, further extending software reusability. Java programs are all built by extending predefined Java classes. The major topics include defining subclasses, using the keywords super and this, using the modifiers protected, final and abstract, polymorphism and dynamic binding, and casting objects. This chapter introduces the object class, which is the root of all Java classes. You will learn to use abstract classes, and interfaces.

Chapter 7, "Arrays and Vectors," explores an important structure: arrays for processing data in lists and tables. You will learn how to declare, initialize, and copy arrays. You will also learn how to use wrapper classes to encapsulate primitive data type values in objects for use in generic programming. This chapter introduces the vector class, which can be used to store an unspecified number of elements.

Part III: Graphics Programming

The third part of the book introduces Java graphics programming. Major topics include event-driven programming, creating graphical user interfaces, and writing applets. You will learn the architecture of Java graphics programming API and use the user interface components to develop graphics applications and applets.

Chapter 8, "Getting Started with Graphics Programming," introduces the concepts of Java graphics programming using Swing components. Topics include the Swing class hierarchy, event-driven programming, frames, panels, and simple layout managers (F1owLayout, GridLayout, and BorderLayout). The chapter also introduces drawing geometric figures in the graphics context.

Chapter 9, "Creating User Interfaces," introduces the user interface components: buttons, labels, text fields, text areas, combo boxes, lists, check boxes, radio buttons, menus, scrollbars, and scroll panes. Today's client/server and Web-based applications use a graphical user interface (GUI, pronounced "goo-ee"). Java has a rich set of classes to help you build GUIs.

Chapter 10, "Applets and Advanced Graphics," takes an in-depth look at applets, discussing applet behavior and the relationship between applets and other Swing classes. Applets are a special kind of Java class that can be executed from the Web browser. Students will learn how to convert applications to applets, and vice versa, and how to run programs both as applications and as applets. The chapter also introduces two advanced layout mangers (cardLayout and GridBagLayout) and the use of no layout. Advanced examples of handling mouse and keyboard events are provided. You will learn how to package and deploy Java applications and applets.

Part IV: Developing Comprehensive Projects

The book's final part is devoted to several advanced features of Java programming. You will learn how to use these features to develop comprehensive programs; for example, using exception handling to make your program robust, using multithreading to make your program more responsive and interactive, incorporating sound and images to make your program user-friendly, using input and output to manage and process a large quantity of data, and creating client/server applications with Java networking support.

Chapter 11, "Exception Handling," teaches students how to define exceptions, throw exceptions, and handle exceptions so that their programs can either continue to run or terminate gracefully in the event of runtime errors. The chapter discusses predefined exception classes, and gives examples of creating user-defined exception classes.

Chapter 12, "Internationalization," introduces the development of Java programs for international audiences. You will learn how to format dates, numbers, currencies, and percentages for different regions, countries, and languages. You will also learn how to use resource bundles to define which images and strings are used by a component depending on the user's locale and preferences.

Chapter 13, "Multithreading," introduces threads, which enable the running of multiple tasks simultaneously in one program. Students will learn how to use the Thread class and the Runnable interface to launch separate threads. The chapter also discusses thread states, thread priority, thread groups, and the synchronization of conflicting threads.

Chapter 14, "Multimedia," teaches how to incorporate sound and images to bring live animation to Java programs. Various techniques for smoothing animation are introduced.

Chapter 15, "Input and Output," introduces input and output streams. Students will learn the class structures of I/O streams, byte and character streams, file I/O streams, data I/O streams, print streams, delimited I/O, random file access, and interactive I/O.

Chapter 16, "Networking," introduces network programming. Students will learn the concept of network communication, stream sockets, client/server programming, and reading data files from the Web server.

Appendixes

This part of the book covers a mixed bag of topics. Appendix A lists Java keywords. Appendix B gives tables of ASCII characters and their associated codes in decimal and in hex. Appendix C shows the operator precedence. Appendix D summarizes Java modifiers and their usage. Appendix E introduces number systems and conversions among binary, decimal, and hex numbers. Appendix F introduces HTML basics. Appendix G lists UML Graphical Notations for describing classes and their relationships. Appendix H introduces packages for grouping classes. Appendix I gives a JBuilder 3.5 tutorial. Finally, Appendix J provides a glossary of key terms used in the text.

Read More Show Less

Customer Reviews

Average Rating 3.5
( 11 )
Rating Distribution

5 Star

(3)

4 Star

(2)

3 Star

(1)

2 Star

(5)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 8 Customer Reviews
  • Anonymous

    Posted May 15, 2000

    Only the book is bulky

    Contents are not enough to give a new JAVA programmer enough information. The author jumps from one topic to another very quickly causing lot of confusion. His examples for basic JAVA are enough but not for advanced ones like multimedia, applets, threading,etc. I wonder how my instructor decided to recommend this book for a new Java programmers.

    2 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted March 13, 2000

    Often confusing, it needs more explanations and better examples

    Liang could improve this book immensely with a fairly small additional effort. Presumably this text is intended for a first time Java student. (This review is based on the assumption of the student having prior procedural programming knowledge, but no Java or C or C++ or object oriented knowledge.) Many first time Java students will frequently be left frustrated with the book because Liang often does not give adequate explanations or reasons for what is being presented. On a number of occasions in the text he throws in Java terms which are not noted, defined, or described until several chapters later. And many of the topics discussed are incomplete and therefore confusing. Also, his examples of Java code are often confusing and usually need far better explanations than are given. Sometimes the focus of the examples shifts from learning Java to trying to figure out algorithms. And the program structure of his example Java code changes as the book progresses with no indication as to why. The student is left wondering how to construct a Java program based on a variety of poorly explained examples with differing structures. It would be of great help to the student for Liang to explain why and how he is constructing the framework of the code. I am using a number of other books to try to figure out what Liang book is attempting to explain, and thus I am spending far more time learning Java than should be necessary. This book could be good with more work on Liang's part, but in its present state it is frequently very confusing. I cannot recommend the second edition of this book for a first time Java student.

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted February 26, 2005

    Pretty good ...

    Does a reasonably good job. It does take a bit of time to accustom to it's style, which is what might be bothering some people. I agree that the book doesn't do a good job of explaning the ending 2-3 sections of chapter 8. Other than that, it's pretty self explanatory with good examples.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted January 17, 2002

    Worse book..... better books are there of Sun Microsystem

    I do not know why the collage people selected this book, which is hard to understand, and not straight forward. Any way I feel is that I dropped my 75 bucks.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted January 17, 2002

    the book was should have been better

    The book was okay but some of the terms were different from the standard terms and what the teacher was telling us and that confused some people. Otherwise, the book showed how you can call constructors in a program inside of methods. That really made programming easier than writing every code.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted September 8, 2001

    Easy reading

    This is a great book if you are just starting out. I recommend this to anyone wanting to go into Java.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted July 17, 2001

    Disappointing Text Book

    This book was chosen for a college course I am taking. I do not know why, for the price there has to be better books out there. I found the examples to be very confusing and vague and the text wordy and confusing as well.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted May 22, 2001

    Below Average

    The book has good examples and teaches you well but there is no solutions to the exercise problems at the end of the chapter. So you don't really know how well you learned the lesson.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 8 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)