Welcome to Java and Java How to Program, Ninth Edition! This book presents leadingedge computing technologies for students, instructors and software developers. The new Chapter 1 engages students with intriguing facts and figures to get them excited about studying computers and programming. The chapter includes a table of some of the research made possible by computers; current technology trends and hardware discussion; the data hierarchy; a table of mobile and Internet app platforms; a new section on social networking; an introduction to Android; a table of popular web services; a table of business and technology publications and websites that will help you stay up to date with the latest technology news and trends; and updated exercises.The book is appropriate for introductory course sequences based on the ACM/IEEE curriculum recommendations and for AP Computer Science exam preparation. We focus on software engineering best practices.
Database and Web Development:
JDBC 4. Chapter 28, Accessing Databases with JDBC, covers JDBC 4 and uses the Java DB/Apache Derby and MySQL database management systems. The chapter features an OO case study on developing a database-driven address book that demonstrates prepared statements and JDBC 4’s automatic driver discovery. Java Server Faces (JSF) 2.0. Chapters 29–30 have been updated to introduce JavaServer Faces (JSF) 2.0 technology, which greatly simplifies building JSF web applications. Chapter 29 includes examples on building web application GUIs, validating forms and session tracking. Chapter 30 discusses data-driven and Ajaxenabled JSF applications.
Multithreading GUI and Graphics:
Object-oriented programming and design. We introduce the basic concepts and terminology of object technology in Chapter 1. Students develop their first customized classes and objects in Chapter 3. Presenting objects and classes early gets students “thinking about objects” immediately andmastering these concepts more thoroughly. [For courses that require a late-objects approach, consider Java How to Program, Late Objects Version, 8/e, which begins with six chapters on programming fundamentals (including two on control statements) and continues with seven chapters that gradually introduce object-oriented programming concepts.] Exception handling. We integrate basic exception handling earlier in the book and instructors can easily pull more material forward from Chapter 11, Exception Handling: A Deeper Look.
Class Arrays and ArrayList. Chapter 7 covers class Arrays—which contains methods for performing common array manipulations—and class ArrayList— which implements a dynamically resizable array-like data structure. This follows our philosophy of getting lots of practice using existing classes while learning how to define your own classes. OO case studies. The early classes and objects presentation features Time, Employee and GradeBook class case studies that weave their way through multiple sections and chapters, gradually introducing deeper OO concepts.
Optional Case Study: Using the UML to Develop an Object-Oriented Design and Java Implementation of an ATM. TheUML™ (UnifiedModeling Language™) is the industry-standard graphical language for modeling object-oriented systems. Chapters 12–13 include an optional case study on object-oriented design using the UML. We design and implement the software for a simple automated teller machine (ATM). We analyze a typical requirements document that specifies the system to be built. We determine the classes needed to implement that system, the attributes the classes need to have, the behaviors the classes need to exhibit and specify how the classes must interact with one another to meet the system requirements. From the design we produce a complete Java implementation. Students often report having a “light-bulb moment”—the case study helps them “tie it all together” and really understand object orientation.
The chapter features a database-driven multitier web address book that allows users to add and search for contacts. This Ajax-enabled application gives the reader a nice sense of Web 2.0 software development. Web services. Chapter 31, Web Services, demonstrates creating and consuming SOAP- and REST-based web services. Case studies include developing blackjack and airline reservation web services. Java Web Start and the Java Network Launch Protocol (JNLP). We introduce Java Web Start and JNLP, which enable applets and applications to be launched via a web browser. Users can install locally for later execution. Programs can also request the user’s permission to access local system resources such as files—enabling you to develop more robust applets and applications that execute safely using Java’s sandbox security model, which applies to downloaded code.
Multithreading. We completely reworked Chapter 26, Multithreading [special thanks to the guidance of Brian Goetz and Joseph Bowbeer—two of the co-authors of Java Concurrency in Practice, Addison-Wesley, 2006]. SwingWorker class. Weuse class SwingWorker to create multithreaded user interfaces.
Scalable GUI and graphics presentation. Instructors teaching introductory courses have a broad choice of the amount of GUI and graphics to cover—from none, to an optional 10-brief-sections introductory sequence woven in with the early chapters, to a deep treatment in Chapters 14, 15 and 25, and Appendix I. GroupLayout layout manager. We discuss the GroupLayout layout manager in the context of the GUI design tool in the NetBeans IDE. JTable sorting and filtering capabilities. Chapter 28 uses these capabilities to resort the data in a JTable and filter it by regular expressions.